How do I know when a thread quits?

Prashanth Ellina prashanthellina at gmail.com
Tue Jun 7 09:28:33 EDT 2005


Hi,

I have used the low-level thread module to write a multi-threaded app.

tid = thread.start_new_thread(process, ())
tid is an integer thread ident.

the thread takes around 10 seconds to finish processing. Meanwhile the
main thread finished execution and exits. This causes an error because
the child thread tries to access something in the sys module which has
already  been GC'ed.  I want a reliable way of knowing when the child
thread finished execution so that I can make the main thread wait till
then.

Any ideas?

TIA,
Prashanth Ellina




More information about the Python-list mailing list