no multithreading?
Fredrik Lundh
fredrik at pythonware.com
Wed Jan 19 10:08:20 EST 2000
moonseeker at my-deja.com wrote:
> I have understood that the python interpreter switches to another thread if a
> fixed amount of python commands is completed. Is this true? That means if a
> task hangs on a command (i.e. file open), all tasks are locked?
nope. python releases the interpreter lock whenever
it calls OS functions that may block.
> What happens if I use sleep() in a task?
http://www.python.org/doc/current/lib/module-thread.html
"Not all built-in functions that may block waiting for
I/O allow other threads to run. (The most popular
ones (time.sleep(), file.read(), select.select()) work
as expected.)"
http://www.python.org/doc/current/api/threads.html
has more info on how this works.
</F>
<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
— see it live on the python conference! -->
More information about the Python-list
mailing list