Irmen de Jong, 05.07.2013 19:12:
> On 5-7-2013 18:59, Steven D'Aprano wrote:
>> I then block until the threads are all done:
>>
>> while any(t.isAlive() for t in threads):
>> pass
>>
>>
>> Is that the right way to wait for the threads to be done? Should I stick
>> a call to time.sleep() inside
On Fri, 05 Jul 2013 19:12:44 +0200, Irmen de Jong wrote:
> On 5-7-2013 18:59, Steven D'Aprano wrote:
>> I then block until the threads are all done:
>>
>> while any(t.isAlive() for t in threads):
>> pass
>>
>>
>> Is that the right way to wait for the threads to be done? Should I
>> stick a
On 05Jul2013 16:59, Steven D'Aprano
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):
| pa
On Fri, Jul 5, 2013 at 10:59 AM, Steven D'Aprano
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
On 5-7-2013 18:59, Steven D'Aprano wrote:
> I then block until the threads are all done:
>
> while any(t.isAlive() for t in threads):
> pass
>
>
> Is that the right way to wait for the threads to be done? Should I stick
> a call to time.sleep() inside the while loop? If so, how long should
On Sat, Jul 6, 2013 at 2:59 AM, Steven D'Aprano
wrote:
> I then block until the threads are all done:
>
> while any(t.isAlive() for t in threads):
> pass
>
Using the threading module, I assume. Is there any reason you can't
simply join() each thread in succession?
ChrisA
--
http://mail.pyth
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
Is that the right way to wait for the threads to be done? S