[Tutor] How to kill a thread

Steven D'Aprano steve at pearwood.info
Sun Nov 22 04:36:17 EST 2015


On Sun, Nov 22, 2015 at 11:23:58AM +0530, CMG Thrissur wrote:
> Hello,
> 
> I have seen some examples of terminating a thread the safe way.  But is 
> there a way to kill a thread without worrying about what happens next. 
> Like thread.stop() or something

No.

Threads in Python cannot be killed. They can only be asked to stop 
themselves.

If you exit the entire process, that will also shut down the threads, 
but that's it.



-- 
Steve


More information about the Tutor mailing list