[Haskell-cafe] Printing of asynchronous exceptions to stderr

Mitar mmitar at gmail.com
Thu Nov 18 06:31:33 EST 2010


On Wed, Nov 17, 2010 at 12:00 PM, Simon Marlow <marlowsd at gmail.com> wrote:
> That's hard to do, because the runtime system has no knowledge of exception
> types, and I'm not sure I like the idea of baking that knowledge into the
> RTS.

But currently it does have a knowledge of interruptible and
uninterruptible exceptions? So adding another which would ctrl-c

> The point of maskUninterruptible is for those
> hoefully rare rare cases where (a) it's really inconvenient to deal with
> async exceptions and (b) you have some external guarantee that the critical
> section won't block.

But is it possible to make an uninterruptible code section which can
timeout? Because once you enter maskUninterruptible probably
System.Timeout does not work anymore? I see uses of
maskUninterruptible (or some derivation of it, preferably) if:

- user would still be able to interrupt it
- you could specify some timeout or some other condition after which
the code section would be interrupted, so you could try for example to
deal with some cleanup code (and you do not want interrupts there) but
if this cleanup code hangs you still want some way to kill it then

Currently, with this absolute/all approach maskUninterruptible is
really not useful much because it masks too much. But I would see a
lot more useful something which would still allow me (and only me, as
a programmer) to interrupt it or user (because user should know what
he/she does). And this is why I argue for some way of being able to
specify which interrupts you still allow: like mask everything
except... (user interrupts, my special exception meant for cleanup
code hanging conditions...).


More information about the Glasgow-haskell-users mailing list