no multithreading?

Gordon McMillan gmcm at hypernet.com
Wed Jan 19 09:57:37 EST 2000


moonseeker asks:
> 
> I have understood that the python interpreter switches to another thread if a
> fixed amount of python commands is completed. Is this true? 

Yes.

> That means if a
> task hangs on a command (i.e. file open), all tasks are locked? 

No. All core Python (and well-behaved C extensions) release 
the lock when about to attempt a blocking operation; then 
reaquire it when done.

> What happens
> if I use sleep() in a task? 

You release the lock (for the approximate duration of the 
sleep).



- Gordon




More information about the Python-list mailing list