Back to search

GIL basics

The GIL lets only one Python thread execute Python bytecode at a time in CPython.

Python Medium Theory

GIL basics

The GIL lets only one Python thread execute Python bytecode at a time in CPython.

  • Affects CPU-bound threads
  • I O waits still benefit
  • Use multiprocessing for CPU-heavy work

GIL basics