Question about thread

Diez B. Roggisch deetsNOSPAM at web.de
Fri Nov 19 16:12:09 EST 2004


> 
> Even after printing "finished creating threads" all spawned threads
> continue its execution up to final "thread nnnn is being destroyed", so
> I think there's no need to take any special action (unless it's Python
> on iSeries, buy this is another story) to wait for completion.

The OP used the module "thread", while you used "threading" and didn't set
setDaemon(False). Then python waits until all threads are finished.

>From the thread module docs:


When the main thread exits, it is system defined whether the other threads
survive. On SGI IRIX using the native thread implementation, they survive.
On most other systems, they are killed without executing try ... finally
clauses or executing object destructors.   

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list