[Haskell-cafe] Re: Asynchronous exception wormholes kill
modularity
Bas van Dijk
v.dijk.bas at gmail.com
Fri Apr 9 05:33:26 EDT 2010
On Fri, Apr 9, 2010 at 3:22 AM, Isaac Dupree
<ml at isaac.cedarswampstudios.org> wrote:
> OK, thanks for the link! In fact, [tell me if my reasoning is wrong...], in
> that fork-definition, the 'putMVar' will never block, because there is only
> putMVar one for each created MVar.
Yes that's correct.
> I seem to remember that any execution of
> putMVar that does not *actually* block is guaranteed not be interrupted by
> asynchronous exceptions (if within a Control.Exception.block) -- which would
> be sufficient. Is my memory right or wrong?
The following documentation seems to suggest that "any function which
_may_ itself block is defined as interruptible":
http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Control-Exception.html#13
That doesn't answer your question precisely however.
If it is the case that operations are only interruptible when they
actually block then I don't need a nonInterruptibleMask in this last
example. However I still need one in my first example because the
takeMVar in decrement may absolutely block.
regards,
Bas
More information about the Libraries
mailing list