[Tutor] another question ( unrelated )

Bob Gailer bgailer at alum.rpi.edu
Fri Jul 20 21:03:42 CEST 2007


shawn bright wrote:
> If i have a thread, of type threading.Thread
> that i initiate with an __init__
> in the
> def run(self):
>      while 1:
>           do some stuff
>
>
> is there a way i can stop this thread and restart this thread from 
> within itself ?
A thread may suspend itself using one of the lock or event objects in 
the Threading module. It does take an external activity to end the 
suspension.

Let's step back and ask what you want to accomplish by stopping and 
restarting. Perhaps there is another way to do it.

-- 
Bob Gailer
510-978-4454 Oakland, CA
919-636-4239 Chapel Hill, NC




More information about the Tutor mailing list