On 05Jul2013 16:59, Steven D'Aprano <[email protected]> 
wrote:
| I have a pool of worker threads, created like this:
| 
| threads = [MyThread(*args) for i in range(numthreads)]
| for t in threads:
|     t.start()
| 
| I then block until the threads are all done:
| 
| while any(t.isAlive() for t in threads):
|     pass

This spins.

How about:

  for t in threads:
    t.join()

Blocks instead of polls.

Cheers,
-- 
Cameron Simpson <[email protected]>

Processes are like potatoes.    - NCR device driver manual
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to