thread, threading; how to kill a thread?

Peter Hansen peter at engcorp.com
Wed Nov 17 16:28:35 EST 2004


Ian Bicking wrote:
> I might reiterate this request, but knowing the standard answer (you 
> can't) -- what if I *really* want to?  

It looks to me sort of as if you are actually reiterating the
request above... but then going ahead and answering your own
question.  Is that what happened here?  Because if it isn't,
I'm not sure what other answer one could give....

> In situations when a thread 
> becomes wedged, I don't know a way to get out of it.  I don't even know 
> a way to end the process elegantly, instead I have to kill -9 the process.
> 
> Even if it messes things up and I have to restart the process at the 
> soonest possible time to clean up the problems, it would be nice to be 
> able to exit the process.  As it is, the only robust way to deal with 
> the situation is to have a separate process that (at the original 
> process's request) will kill it, an assisted-suicide style.  That's 
> awkward to handle.
> 
> This is an issue with long-running threaded servers (like Webware or 
> even Zope), where even in the face of bugs it's important to keep the 
> service up.



More information about the Python-list mailing list