Unlocking the Parallel Universe: Subinterpreters and Free-Threading in...
summary
Claims that Python 3.12 subinterpreters beat multiprocessing on small overhead and that Python 3.13’s optional free-threading can run threads truly parallel are demonstrated with concrete code: compiled CPython from source with disable-gil and experimental JIT, a hypercorn-based multi-worker multi-thread ASGI server, and microbenchmarks (pi: threads 0.04s for 200 digits, 2.3s for 2000; subinterpreters slightly slower at 200 but faster at 2000). Demo runs 8 subinterpreters in one process, hot reload works, but C-extension ABI and current disabled-optimization slowdowns remain practical blockers.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 2:13Nature of parallelism
- 4:18Python execution models
- 5:22Sub-interpreters explained
- 7:45Free-threading in 3.13
- 9:49Performance and compatibility
- 13:54Web application architecture
- 16:01Live demo and implementation
- 24:10Strategic considerations
- 27:13Conclusion and Q&A
related talks
29mGoodbye GIL: Exploring the Free-threaded mode in Python
30mA Per-Interpreter GIL: Concurrency and Parallelism with Subinterpreters
10mRedlining Your CPU for Fun and Profit: Threading and Multiprocessing in Python
30mParallel computing in Python: Current state and recent advances
31mPython Multithreading and Multiprocessing: Concurrency and Parallelism
30mFree threaded Python past, present and future
35mWriting robust, readable, and maintainable concurrent programs in Python
48mPython Performance: Past, Present and Future
