PEP 805 proposes race-free parallel Python by default
Mark Shannon’s plan would require explicit sharing of objects across threads, building on free-threading work with runtime checks and freezing.
Mark Shannon has published PEP 805, Safe Parallel Python, a design for race-free parallel execution inside CPython. Under the proposal, sharing objects between parallel threads would be prohibited unless those objects are explicitly declared safe to share. The goal is a unified model that is safer than free-threading alone, allows more sharing than isolated interpreters, and aims for better performance than either approach on its own.
The PEP builds on PEP 703 (removing the global interpreter lock) and PEP 734 (multiple interpreters). It would add modest per-object state so the runtime can cheaply check whether an operation is safe and raise when it is not. Freezing objects so they can be shared without races is central; deep freezing is left as possible later work.
On the Python discussion board, early reaction mixed support with hard questions. Steve Dower welcomed the direction and urged that objects become protected or transferred as transparently as possible, with concrete samples showing how ordinary code moves from a serial loop to a parallel one. Others asked how libraries such as NumPy would adopt the model in C, whether a matching C API exists, and how the Steering Council can judge the idea without a prototype comparable to the earlier nogil fork. Several people pressed on shallow versus deep freezing, including how a frozen dict with mutable values would behave, and how the plan relates to the separate deep-immutability proposal in PEP 795.
For extension authors, the appeal is practical: free-threading support today often means wrapping nearly everything in critical sections “just in case,” with real costs even for careful users. A default-safe model could reduce that burden if the runtime, rather than every library, carries more of the safety work.
Shannon frames the change as race freedom by default rather than another opt-in concurrency toolkit. Whether that sticks will depend on adoption cost, ABI fallout, and whether shallow freezing is enough to deliver the safety the PEP claims.