You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using forever $ threadDelay 1000000, I needed both -threaded and -with-rtsopts=-N to get it to work. When using forever $ getLine, I only needed -threaded. Perhaps this should be mentioned in the docs.
The GHC docs say that omitting -N is equivalent to passing -N1. I don't totally understand why your program wouldn't work when run with a single Haskell capability. Does it fail to print anything at all? I'd expect the main thread to yield to the callback thread in between threadDelay 1000000 calls but maybe some deadlock is happening with foreign function calls.
I'm not sure if there are any checks we can add to the code to prevent this, the same way we did to check for -threaded on Windows. Like you said, doing non-blocking stuff in the event handler with -N1 is a valid way to use this library. But a note in the docs about threading pitfalls sounds good.
Uh oh!
There was an error while loading. Please reload this page.
When using
forever $ threadDelay 1000000
, I needed both-threaded
and-with-rtsopts=-N
to get it to work. When usingforever $ getLine
, I only needed-threaded
. Perhaps this should be mentioned in the docs.The text was updated successfully, but these errors were encountered: