[plt-scheme] Chaining exception handlers between threads

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Feb 27 08:41:22 EST 2008

At Mon, 25 Feb 2008 21:41:49 +0000, "Noel Welsh" wrote:
> Thanks.  Got it working following Robby's suggestion.  Should the
> documentation note that the uncaught-exception-handler is a
> non-preserved value?  I assume that's what is going on here.

No, `uncaught-exception-handler' is a normal parameter.

Maybe you have in mind that `with-handlers' and
`call-with-exception-handler' set the parameter? They don't. The
current exception handler is determined separately from the
parameterization --- unless there isn't a handler in the current
continuation, in which case `uncaught-exception-handler' is used.

Matthew

> On Mon, Feb 25, 2008 at 5:40 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > You can also set the `uncaught-exception-handler' parameter.
> >
> >  Matthew
> >
> >
> >
> >  At Mon, 25 Feb 2008 11:13:36 -0600, "Robby Findler" wrote:
> >  > It is probably easiest to propogate the exceptions yourself:
> >  >
> >  > (thread (lambda () (with-handlers ((exn? (lambda (e) (channel-put
> >  > exn-chan e)))) ...whatever you were going to do...)))
> >  >
> >  > and then have the main thread wait on the exn-chan.
> >  >
> >  > If the main thread was doing useful separately from the other threads,
> >  > and you want to interrupt it somehow, I'd suggest not doing that, but
> >  > instead moving that work to a new child thread, but you may have other
> >  > reasons that that won't work, so a few more details might help.
> >  >
> >  > Robby
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.