usleep hangs, no threads
import System.Posix.Unistd main = flip mapM_ [0..] $ \i -> do
The above program hangs after a variable number of iterations (usually around 120, sometimes up to 200, often before the first call to print).
The documentation for usleep warns about bad interactions with threads, but the above program doesn't use any.
The problem also occurs with nanosleep, but not with threadDelay.
#1156 (closed) sounds related, but this time the problem also occurs without -threaded.
workaround: use threadDelay.