Howto pass exceptions between threads

John Nagle nagle at animats.com
Mon Mar 5 13:03:39 EST 2007


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



More information about the Python-list mailing list