Just following up to my problem, I was seeing lots of hangs in various places in my program when it was built with the threaded runtime.
I eventually tracked every single hang back to calls to MissingH's System.Cmd.Utils, including pipeFrom, pipeTo, pipeBoth, and pOpen. I was at this point running my program in a loop 1000 times, and it'd hang between 1 and 10 times on average, since these hangs seem to be timing-related. In all cases, when it hung, it had forked a child, and the child was blocked in a futex() call. Each of these functions calls forkProcess, and then does some very simple setup before it calls executeFile -- but as far as I could see, the forked process never ran a single thing before hanging. The solution, for me, was to convert all my code to use System.Process instead of System.Cmd.Utils. It seems that System.Process does all its setup between fork and exec using C code, and so avoids this problem. I think it'd make sense to either add deprecation warnings to System.Cmd.Utils, or to rewrite it to be a wrapper around System.Process. -- see shy jo
signature.asc
Description: Digital signature