A global interpreter lock (GIL) is a mechanism used in programming language interpreters (specifically in Python and Ruby) to synchronise the execution of threads so that only one native thread (per process) can execute basic operations (memory allocation, reference counting). In practice, what this means is that a GIL language will only see one thread executing at a time.

In Python, the existence of the GIL means that it’s difficult to achieve parallelisation and concurrent code. This does allow single-threaded programs to increase speed, because there’s no need to require using locks.