On Thu, Apr 8, 2010 at 11:45 PM, Bas van Dijk <v.dijk....@gmail.com> wrote: > On Thu, Apr 8, 2010 at 9:15 PM, Isaac Dupree > <m...@isaac.cedarswampstudios.org> wrote: >> I still would like to see examples of where it's needed, because I slightly >> suspect that wrapping possibly-blocking operations in an exception handler >> that does something appropriate, along with ordinary 'mask', might be >> sufficient... But I expect to be proved wrong; I just haven't figured out >> how to prove myself wrong. > > Take my threads package, I uploaded to hackage yesterday, as an example. > > In Control.Concurrent.Thread.Group.fork...
Control.Concurrent.Thread.fork is a similar and simpler example of why nonInterruptibleMask is needed: http://hackage.haskell.org/packages/archive/threads/0.1/doc/html/src/Control-Concurrent-Thread.html#fork If an asynchronous exception is thrown during the 'putMVar res' any waiters on the thread will never be woken up. regards, Bas _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe