how to drop all thread ??

Diez B. Roggisch deetsNOSPAM at web.de
Mon Nov 29 06:40:17 EST 2004


Leon wrote:

> if class A(
> use threading,thread module
> ) to produce 100 thread,how to drop its (100 thread) when its running

By exiting. There is no other way to stop a thread by force. Of course you
can write a run()-method like this:


def run(self):
    while self.running_condition:
        # do something
        pass

If that running-condition is queried often enough, you can stop the thread
by setting it to false.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list