Python's Infamous GIL
summary
Explains what the GIL actually does with concrete examples: shows reference counting races down to pseudo-assembly, demonstrates deadlocks and priority-inversion, and quantifies past experiments — the free-threading patch runs 4–7× slowdown, atomic test-and-set makes CPython about 30% slower. Lays out what was changed in Python 3 to reduce starvation, compares CPython’s refcounting+C API to other interpreters’ GC, and spells the real costs and compatibility barriers to removing the GIL.
AI-written summary · about
chapters (19)
- 0:00python's infamous gil
- 0:391992
- 3:28reference counting with threads
- 6:41multiple locks
- 7:31deadlock
- 8:50introducing: the gil
- 9:05gil ramifications
- 10:18sharing the gil in i/o bound code
- 11:12dave beazley's gil research
- 12:58release ACQUIRE release ACQUIRE
- 13:45the "new gil"
- 15:03meanwhile... the world has changed
- 16:14running python across multiple cores
- 16:47the "free-threading" patch
- 17:38atomic incr/decr
- 18:14python interpreters
- 18:59pure garbage collection
- 19:48modern language vms
- 21:23my opinion
related talks
38mDemystifying the GIL
28mGIL: Everything You Wanted to Know and Were Afraid to Ask
30mFree threaded Python past, present and future
29mTrying No GIL on Scientific Programming
29mGoodbye GIL: Exploring the Free-threaded mode in Python
43mGIL: What's the hassle and... should I care?
32mGIL - What it is and how to fight it
31mGetting Around the GIL: Parallelizing Python for Better Performance
