Kevin wrote:
> The best way to do this is by using a flag or event that the child-threads
> monitor each loop (or multiple times per loop if it's a long loop). If the
> flag is set, they exit themselves.
>
> The parent thread only has to set the flag to cause the children to die.
Doesn't work, b
The best way to do this is by using a flag or event that the child-threads
monitor each loop (or multiple times per loop if it's a long loop). If the
flag is set, they exit themselves.
The parent thread only has to set the flag to cause the children to die.
Kevin.
"Bryan Olson" <[EMAIL PROTECT
iclinux wrote:
> a. how to exit the whole process in a thread?
> b. when thread doing a infinite loops, how to terminate the process?:
As others noted, the threading module offers Thread.setDaemon.
As the doc says: "The entire Python program exits when no active
non-daemon threads are left."
Py
iclinux wrote:
> hi there,
>
> I'm new to python, and have two questions:
>
> a. how to exit the whole process in a thread?
sys.exit()
Works only if Thread.setDaemon(True) is invoked on all threads.
> b. when thread doing a infinite loops, how to terminate the process?:
> it seems that th
hi there,
I'm new to python, and have two questions:
a. how to exit the whole process in a thread?
b. when thread doing a infinite loops, how to terminate the process?:
it seems that the follow doesn't work, in my Windows XP:
thread.start()
thread.join()
Regards
--