Understanding behavior of BlockedIndefinitelyOnMVar exception
Felipe Almeida Lessa
felipe.lessa at gmail.com
Mon Jul 25 04:02:36 CEST 2011
On Sun, Jul 24, 2011 at 7:56 PM, Brandon Simmons
<brandon.m.simmons at gmail.com> wrote:
> What I think I've learned here is that the BlockedIndefinitelyOnMVar
> exception is raised in all the blocked threads "at once" as it were.
> That despite the fact that the handler code in 'lockPrint' restores
> the lock for successive threads.
> This would also seem to imply that putMVar's in an exception handler
> don't stop the runtime from raising the BlockedIndefinitelyOnMVar. But
> that doesn't really seem right.
Does anything change if you somehow force a GC sometime after "good2"?
Perhaps with some calculation generating garbage, perhaps with
performGC. IIRC, the runtime detects BlockedIndefinitelyOnMVar on GC.
But I'm probably wrong =).
More information about the Glasgow-haskell-users