On 2007-08-31, herman <[EMAIL PROTECTED]> wrote:
> Hi,
>
> 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()
>                 threads.append(t)
>
>             for t in threads:
>                 t.join(60*5)
>                 print "thread join\n"
>
>             # wait for 5 minutes for all the threads to complete ,
> and
>             # 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.

  
http://groups.google.com/group/comp.lang.python/browse_thread/thread/2002d29c965534cc/5833130893cee567?lnk=st&q=&rnum=2&hl=nl#5833130893cee567
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to