#4810: Versions of bracket without masking acquire action
---------------------------------+------------------------------------------
Reporter: mitar | Owner:
Type: proposal | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 7.0.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by simonmar):
Replying to [comment:8 mitar]:
> Replying to [comment:7 simonmar]:
> > FFI isn't interruptible whether you're inside `mask` or not.
>
> I was not saying otherwise. ;-) Just stating how you can get a lengthy
acquire.
But it wouldn't make a difference if it was unmasked, it would still not
be interruptible.
> > Now that's a very good idea.
>
> In fact I do not really like it. ;-)
>
> And I do not really see much difference between `allowInterrupt` and
`unblock yield`.
There's no difference semantically. `unblock yield` is an implementation
of `allowInterrupt`, but a better implementation is just `unblock (return
())`.
> You still unmask where you maybe should not (from a caller point of
view).
Not true - any operation can potentially raise asynchronous exceptions, by
being interruptible. This is just a way to be interruptible without
actually invoking an interruptible operation, which all involve blocking.
I like it!
> I am only saying there should be a function in a standard library so
that you do not need to write your own.
Then I misunderstood what you wanted `blockWithUnmask` to do. Could you
show me the code?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4810#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs