AI engineering glossary · Computing foundations
What is GIL (global interpreter lock)?
Global interpreter lock (also called GIL): A lock in the standard CPython interpreter that lets only one thread execute Python bytecode at a time. It simplifies memory management but stops pure-Python threads from using several cores, so CPU-heavy work uses multiple processes instead.
Global interpreter lock: an example
Two threads each doing heavy pure-Python arithmetic do not run twice as fast in CPython, but two processes would.
Related terms
More Computing foundations terms
- Graphical user interface
- Graphics processing unit
- Half-precision floating point
- Hard disk drive
- Hard link
- Hash function
- Heap
- Hexadecimal
Where you learn it
Global interpreter lock is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.