safest way to kill a thread

limodou limodou at
Wed Jan 19 02:46:36 EST 2005

I think only those threads which invoked with setDaemon() method will 
exit, and others will not,  as the main program exit.

martinnitram at wrote:
> limodou wrote:
>>Using Thread's method setDaemon() before you call the start() method.
>>Just like :
> thank for fast reply.
> from doc, said that setDaemon() function as
> "The entire Python program exits when no active non-daemon threads
> are left."
> is it mean that when the main program exit (normally/abnormally), all
> threads created will also exit?
>   Thank again.

I love python!
My Blog:

More information about the Python-list mailing list