We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

What is the Global Interpreter Lock?

The Global Interpreter Lock (GIL) is used to protect Python objects from being modified from multiple threads at once. Only the thread that has the lock may safely access objects.

To keep multiple threads running, the interpreter automatically releases and reacquires the lock at regular intervals (controlled by the sys.setcheckinterval function). It also does this around potentially slow or blocking low-level operations, such as file and network I/O.

Also see:

what-kinds-of-global-value-mutation-are-thread-safe

can-t-we-get-rid-of-the-global-interpreter-lock

CATEGORY: general