How does the IO manager handle reading regular files?

Niklas Hambüchen mail at nh2.me
Mon May 14 21:29:27 UTC 2018


Also funny but perhaps not too surprising:

If in my code, you replace `forkIO` by e.g. `forkOn 2`, then nondeterministically, sometimes the program hangs and sometimes it works with +RTS -N2.

The higher you set -N, the more likely it is to work.

If you put both the putStrLn loop and the readFile into `forkOn 0` and `forkOn 1` each, and run with +RTS -N3, then it always works as expected.


More information about the ghc-devs mailing list