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.

Level: advancedTopic: Computing foundations

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.