How to kill threading.Thread instance?

Diez B. Roggisch deets at nospam.web.de
Sun Sep 21 10:38:21 EDT 2008


dmitrey schrieb:
> I wonder why something like myThread.exit() or myThread.quit() or
> threading.kill(myThread) can't be implemented?
> Is something like that present in Python 3000?

Not that I'm aware of it (which doesn't mean to much though).

However I *am* aware of the bazillions discussions that have been held 
over this here - and the short answer is: it is a generally very bad 
idea to terminate threads hard, as it can cause all kinds of corruption.

Systems like Java discourage the use of the available methods for that 
as well. And I for example once worked with Qt3-threads, what allow for 
this kind of operation - and killed my CORBA-ORB running in the same 
process by terminating the thread hard.

Google a bit in this NG to find the discussions & reasons.

Diez



More information about the Python-list mailing list