In Python's reference implementation (CPython) the Global Interpreter Lock (GIL) is a mutex which limits execution of Python bytecode to run on only a single thread at a time. This prevents race conditions where multiple threads might otherwise cause…