Threads in Python version 1.5, thread doesn't start until calling process dies

Guido van Rossum guido at python.org
Thu Jul 26 10:03:14 EDT 2001


"Bill Bell" <bill-bell at bill-bell.hamilton.on.ca> writes:

> kentabacchi at excite.com (Ken Tabacchi)	 wrote, in part:
> > I am having some trouble with a threadded process in Python version
> > 1.5.  It seems that the thread does not start until the calling
> > process has died.  The thread starts immediately when the following
> > program is run under Python version 2.1.
> 
> Interesting one (for me, anyways).
> 
> Please forgive my ignorance: would I be correct to surmise that 1.5 
> lacks 'threading' and locks?

The 'threading' module was introduced in Python 1.5.1.  But the
'thread' module is much older, dating back to 0.9.8 at least.  The
thread module supports locks, too.

I don't know what to do about the original caller's problem, but on
some operating systems it helps to put a time.sleep(0.001) in the main
program after forking another thread, to allow the other thread to be
scheduled.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list