Conquer multithreaded Python with Blanket
summary
Blanket claims deterministic control of multithreaded Python by replacing thread primitives with wrappers rooted in a scenario object that serializes and orders operations. Tests drive explicit transaction/parking states so a race that occurs only in ABC order can be replayed as ABC every run (example: BAC/CAB becomes stable). Implementation uses real locks underneath, offers module monkey‑patching and an injector for bytecode to make lockless code reproducible, and targets unit testing rather than production.
AI-written summary · about
chapters (14)
- 0:00Multithreading challenges in Python
- 1:53What is Blanket
- 3:18Threading module limitations
- 5:43Rewriting tests with Blanket
- 8:50Blanket's scenario object
- 11:17Blanket's transaction concept
- 15:24How scenario.wait works
- 19:55Blanket low-level API
- 23:23Blanket medium-level API
- 26:34Blanket high-level APIs
- 31:03Blanket architecture
- 34:32Blanket testing approach
- 36:58Blanket development journey
- 38:20Performance and Q&A
related talks
40mAdvanced asyncio: Solving Real-world Production Problems
30mMonkey patching
12mDon’t Be ‘Thread’-ened: Testing Multithreaded Code with Confidence
31mPortable and Fast - How to implement a parallel test runner
47mREPL-driven development
43mOmg, how do I write software that isn't a ticking timebomb!?
43mPytest Tests in Twister
43mPytest Tests in Twister
