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

Adam Jorgensen adam.jorgensen.za at gmail.com
Mon Sep 19 02:03:08 EDT 2011


The point of the Java thread.stop() being deprecated seems to have very
little to do with undeclared exceptions being raised and a lot to do
with objects being left in a potentially damaged state.

As Ian said, it's a lot more complex than just adding try/catches. Killing a
thread in the middle of some non-atomic operation with side-effects
that propagate beyond the thread is a recipe for trouble.

In fact, while a a lot can be written about Java being a poor language the
specific article linked to about why Java deprecated thread.stop()
gives a pretty damn good explanation as to why Thread.stop() and the like
are a bad idea and what a better idea might be (Signalling that
a graceful halt should be attempted)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110919/db889e1e/attachment-0001.html>


More information about the Python-list mailing list