How can I wait for all the threads I spawn for 5 minutes
apardon at forel.vub.ac.be
Mon Sep 3 15:43:20 CEST 2007
On 2007-08-31, herman <Herman.Schultz at gmail.com> wrote:
> In my python program, I would to like to spwan 5 threads, for the them
> for 5 minutes maximum and the continue. Here is my script:
> threads = 
> for j in range(5):
> t = MyThread()
> for t in threads:
> print "thread join\n"
> # wait for 5 minutes for all the threads to complete ,
> # then continue
> But this code ends up waiting 5 minutes for **each** thread. that is
> not what I want. I just want to wait for 5 minutes for all threads.
> how can I do that?
> And after 5 minutes, i want to kill off all the threads I spawn
> earlier, how can I do that in python.
You may wish to look at this. No guarantee though.
More information about the Python-list