Killing threads (was Re: Cancel or timeout a long running regular expression)

Terry Reedy tjreedy at udel.edu
Sun Sep 18 01:30:31 CEST 2011


On 9/17/2011 7:19 PM, Chris Angelico wrote:
> On Sun, Sep 18, 2011 at 8:27 AM, Chris Rebert<clp2 at rebertia.com>  wrote:
>> It's possible that the reason is analogous to why Java has deprecated
>> its equivalent, Thread.stop():
>> http://download.oracle.com/javase/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html
>
> Interesting. The main argument against having a way to raise an
> arbitrary exception in a different thread is that it gets around
> Java's requirement to declare all exceptions that a routine might
> throw - a requirement that Python doesn't have.

I saw the main argument as being that stopping a thread at an arbitrary 
point can have an arbitrary, unpredictable effect on all other threads. 
And more so that shutting down an independent process.

-- 
Terry Jan Reedy




More information about the Python-list mailing list