If a callback into Haskell code finishes very quickly, a deadlock occurs. Adding a small delay helps.
This is what I think happens: rts_evalIO creates a haskell thread rts_evalIO calls scheduleExtThread to spawn a new OS thread. When the callback is finished, schedule() calls broadcastCondition on m->wakeup. But because the callback took very little time, this happens _before_ rts_evalIO calls waitThread. waitThread is responsible for initializing m->wakeup and waiting for a broadcast, but broadcastCondition might already have been called _before_ that. It won't be called again, so nothing happens anymore... Some locking to prevent this race condition is probably necessary... Cheers, Wolfgang _______________________________________________ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
