unsafePerformIO in threaded applications does not work
问题 Below is the source of a sample program: When I run it from ghci both printJob and printJob2 run fine and write ten lines into a text file. But when compiled with -threaded flag, the program writes only one line. I have ghc 7.0.3 on ArchLinux Here's the compile command: ghc -threaded -Wall -O2 -rtsopts -with-rtsopts=-N -o testmvar testmvar.hs What am I am doing wrong ? Why it does not work in threaded mode ? import Control.Concurrent.MVar import Control.Concurrent (forkIO) import Control