The building blocks
Behavior-Oriented Concurrency (BOC) is the model the trio is proposing for a high-level concurrency interface for Python. [1]
Programs written with the BOC model are task-based. [2]
Tasks are lightweight, can run on any core, and cannot deadlock. [3]
Each task owns data that is protected by mutexes, but unlike the threading.Lock objects that we’re used to in Python, these mutexes are aware of the data that they protect. [4]
BOC calls these mutexes “Cowns”, meaning “concurrent owner”. [5]
BOC allows defining which mutexes a task depends on using the @when decorator. [6]
What the scheduler gets
This data awareness means that the mutexes can ensure that the data objects are only accessed by a single task at a time, providing isolation and preventing data races. [7]
Providing a scheduler with a program written with the above constraints gets you three important properties: no deadlocks, no data races, and good “locking discipline”. [8]
Where the proposal sits
Python’s free-threading project has made considerable progress since PEP 779’s acceptance. [9]
But there was one aspect of PEP 779’s acceptance criteria that hadn’t been addressed yet: high-level concurrency primitives. [10]
The Python core team should begin considering and proposing higher-level concurrency primitives that users can use safely and effectively, without requiring a deep understanding of the underlying threading mechanism. [11]
Sources
- The Python Software Foundation source says: Behavior-Oriented Concurrency (BOC) is the model the trio is proposing for a high-level concurrency interface for Python. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: Programs written with the BOC model are task-based. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: Tasks are lightweight, can run on any core, and cannot deadlock. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: Each task owns data that is protected by mutexes, but unlike the threading.Lock objects that we’re used to in Python, these mutexes are aware of the data that they protect. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: BOC calls these mutexes “Cowns”, meaning “concurrent owner”. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: BOC allows defining which mutexes a task depends on using the @when decorator. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: This data awareness means that the mutexes can ensure that the data objects are only accessed by a single task at a time, providing isolation and preventing data races. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: Providing a scheduler with a program written with the above constraints gets you three important properties: no deadlocks, no data races, and good “locking discipline”. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: Python’s free-threading project has made considerable progress since PEP 779’s acceptance. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: But there was one aspect of PEP 779’s acceptance criteria that hadn’t been addressed yet: high-level concurrency primitives. Free-Threaded Python Post-Era (Python Language Summit 2026)
- The Python Software Foundation source says: The Python core team should begin considering and proposing higher-level concurrency primitives that users can use safely and effectively, without requiring a deep understanding of the underlying threading mechanism. Free-Threaded Python Post-Era (Python Language Summit 2026)