Re: Howto pass exceptions between threads



John Nagle schrieb:
Alexander Eisenhuth wrote:
Hallo Alltogether,

I've searched in this mailing list, but it seems to me that there is no general approach to pass exceptions from one thread to another.

Very few languages have that.

Actually, it could be made to work for Python, but it would have to
be carefully designed. Something that raises an exception in another
thread the next time the thread blocks would have relatively sane
semantics. You couldn't raise an exception on a compute-bound thread,
only at block points (locks, I/O, long system calls.)

John Nagle

Yes you're right, it must be well designed with a clear responsibility delegation. I can imgagine the following points:

- Thread termination with termination handler (for Thread instance)
- Main Thread information / synchronisation
- Default/Customized main thread exception handler
.



Relevant Pages

  • Re: M2Crypto possible intermittent bug
    ... John Nagle wrote: ... running my regression tests. ... M2Crypto raises the exception SSL.SSLError, ... running Python 2.4 (which is what M2Crypto ...
    (comp.lang.python)
  • Re: Creating an error handler for my application
    ... If an exception is being thrown, ... >catched by the ThreadException event and a exception is being displayed. ... it has a default thread exception handler which ...
    (microsoft.public.dotnet.csharp.general)