December 2000
Intermediate to advanced
816 pages
16h 57m
English
Execution by Python code is controlled by the Python Virtual Machine (a.k.a. the interpreter main loop), and Python was designed in such a way that only one thread of control may be executing in this main loop, similar to how multiple processes in a system share a single CPU. Many programs may be in memory, but only one is live on the CPU at any given moment. Likewise, although multiple threads may be “running” within the Python interpreter, only one thread is being executed by the interpreter at any given time.
Access to the Python Virtual Machine is controlled by a global interpreter lock (GIL). This lock is what ensures that exactly one thread is running. The Python Virtual Machine ...
Read now
Unlock full access