Paul Rubin wrote:
Carl Banks <pavlovevide...@gmail.com> writes:
Say you are running a thread and you want the power to be able to kill
it at any time.  The thread is either communicating with the rest of
the program periodically, or it isn't.  If it is, then there are ample
opportunities to tell the thread to terminate itself.  If it isn't,
then you might as well use a separate process which you can kill.

That's not so satisfying.  If you use a separate process, it can't
share Python objects with the main process, isn't under the same
memory management, etc.
But precisely because of that sharing the thread may be in the middle
something that "must complete" -- no with-statement locking will get
unlocked, no "finally:" clauses in code in the standard library, no
... -- there is just too much that goes wrong when a thread is
infinitely starved (which, in effect, is what would happen if you
could kill it).

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to