On 03/25/10 12:36, Simon Marlow wrote:
I'd also be amenable to having block/unblock count nesting levels
instead, I don't think it would be too hard to implement and it wouldn't
require any changes at the library level.
Wasn't there a reason that it didn't nest?
I think it was that operations that block-as-in-takeMVar, for an
unbounded length of time, are always supposed to C.Exception.unblock and
in fact be unblocked within that operation. Otherwise the thread might
never receive its asynchronous exceptions.
Thus, if within a C.Exception.block, you call an IO that might block,
such as takeMVar, modifyMVar_, or an arbitrary "IO x" argument to your
function, then you must take care to handle its exceptions (for example,
in the case of modifyMVar_'s implementation, to rollback the MVar to its
previous value).
-Isaac
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe