david at no.westcontrol.spam.com
Wed Sep 11 04:54:44 EDT 2002
I've just been reading a little about the GIL and threading in python, and I
have a couple of questions that I hope someone can answer.
Am I right in thinking that threading in Python does not use the underlying
OS's threads, but effectively implements its own scheduler? Or does it use
the OS's threads, but uses the GIL to ensure that only one is runable at a
On a dual-processor system, does this mean that only one thread of a Python
program can run at a time, even when both CPUs are free, so that two
seperate python interpreter processes are needed to take advantage of the
What about when a Python thread is blocked for some other reason, such as
while waiting for a file read - will that block other threads, or will the
waiting thread definitely release the GIL and allow other threads to run?
If the GIL does block all threads in this manner, are there any plans to
introduce more fine-grained locking to improve scalability, analagous to
locking in the Linux kernel?
More information about the Python-list