[Python-ideas] Thread exceptions and interruption
Alex Holkner
aholkner at cs.rmit.edu.au
Wed Sep 19 06:40:09 CEST 2007
Adam Olsen wrote:
> Here I use a with-statement[2] to create a branch point. The branch
> point collects any exceptions from its children and interrupts the
> children when the first exception occurs. Interruption is done
> somewhat similarly to posix cancellation; participating functions
> react to it. However, I raise an Interrupted exception, which can
> lead to much more graceful cleanup than posix cancellation. ;)
It sounds like you're proposing that a thread can be interrupted at any
time. The Java developers realised long ago that this is completely
unworkable and deprecated their implementation:
http://java.sun.com/j2se/1.3/docs/guide/misc/threadPrimitiveDeprecation.html
Please disregard if I misunderstood your approach :-)
Alex.
More information about the Python-ideas
mailing list