is it safe to stop a thread?

Tim Peters tim.one at home.com
Wed May 23 17:10:32 EDT 2001


[Parzival Herzog]
> Dustin, (and I, and perhaps others) want not to have the OS kill
> some OS thread, but a way to signal a python program running in
> a thread, e.g. raise an exception handled by the subject thread,
> say "thread.alerted" that alerts that thread.  The thread can handle
> the exception in any way it wants, including to terminate itself.

This comes up regularly, but until somebody wants it enough to write a PEP,
and somebody else enough to implement the PEP, nothing will change.

> ...
> I don't see what the platform OS issue with that would be, it
> seems to me to be a Python interpreter issue. Several Modula-3
> implementation do it in a machine and OS independent way, and
> they don't even have the advantage of an interpreter loop.

The PEP should flesh out how to accomplish that wrt Python's internals, then,
if the PEP author believes Modula-3's is an adequate solution.





More information about the Python-list mailing list