Skip to content
IJK

Behavior-Oriented Concurrency: The Proposed Building Blocks

By IJK ·

The tasks, cowns and decorator of the Behavior-Oriented Concurrency model proposed at the Python Language Summit 2026, and the three properties its write-up lists.

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]

declares withdepends onTasklightweight, can run on any core@when decoratornames the cowns a task depends onCownmutex aware of the data it protects
How do tasks, cowns and the @when decorator relate in the proposed model?

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

  1. 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)
  2. The Python Software Foundation source says: Programs written with the BOC model are task-based. Free-Threaded Python Post-Era (Python Language Summit 2026)
  3. 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)
  4. 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)
  5. The Python Software Foundation source says: BOC calls these mutexes “Cowns”, meaning “concurrent owner”. Free-Threaded Python Post-Era (Python Language Summit 2026)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
  11. 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)

Editorial (AI-assisted; automatically checked, not human-reviewed). Each statement is linked to its source; check the source before relying on a detail.

  • python
  • concurrency
  • free threading
  • language summit