Threads: does Thread.start() atomically set Thread.__started ?

Peter Hansen peter at engcorp.com
Wed Mar 15 08:54:08 EST 2006


Enigma Curry wrote:
> Can some kind person please further my education on Threads?
> 
> When I create a thread called "t" and I do a "t.start()" am I
> guaranteed that "t.isAlive()" will return True as long as the thread
> hasn't already completed? Put another way, does "t.start()" ever return
> before t.__started is set to True?

Did you check the source?  It's fairly straightforward, as I recall. 
(threading.py in the python library)

-Peter




More information about the Python-list mailing list