The GIL is dead: PyPy-STM
summary
PyPy-STM removes the GIL so Python code can run threads on multiple cores: Richards benchmark drops from 8.01s to 2.5s (2/4 core laptop) and a pure‑Python 3D renderer roughly doubles throughput when parallelized. The implementation instruments reads/writes, detects conflicts and now provides reports about the "STM conflicts" so large codebases can be incrementally fixed. Practical caveats: transactions that do I/O cannot be rolled back, short sections that mix CPU and I/O hurt performance, and single‑threaded runs are 25–40% slower.
AI-written summary · about
chapters (15)
- 0:00Intro
- 1:26What is PyPySTM
- 1:55What is STM
- 2:08What is PITie
- 2:31PITie example
- 3:51Subprocessing
- 5:27Example
- 11:03Multithreaded program
- 13:29Multithreaded example
- 15:17Conclusion
- 17:54Running two threads
- 20:10Input output
- 20:49STM vs GIL
- 22:39Model to program
- 25:24Questions
related talks
29mGoodbye GIL: Exploring the Free-threaded mode in Python
29mTrying No GIL on Scientific Programming
38mDemystifying the GIL
39mCPython, Grumpy, PyPy - When, How, Why
30mFree threaded Python past, present and future
31mGetting Around the GIL: Parallelizing Python for Better Performance
39mUnlocking the Parallel Universe: Subinterpreters and Free-Threading in...
28mTrying No GIL on Scientific Programming
