Skip to content
Tech News
← Back to articles

Behavior-Oriented Concurrency for Python

read original more articles
Why This Matters

Behavior-oriented concurrency (BOC) introduces a new way to handle parallelism in Python by assigning unique data ownership to behaviors, eliminating the need for locks and simplifying concurrent programming. This approach enhances code clarity, maintainability, and scalability, making it easier for developers to leverage multi-core processors. The implementation in Python broadens access to this paradigm, promising improved performance and easier development for Python-based applications.

Key Takeaways

Getting Started

pip install bocpy

What is BOC?

Behavior-oriented concurrency (BOC) is a new paradigm for parallel and concurrent programming which is particularly well-suited to Python

In a BOC program, data is shared such that each behavior has unique temporal ownership of the data, removing the need for locks to coordinate access. For Python programmers, this brings a lot of benefits. Behaviors are implemented as decorated functions, and from the programmer's perspective, those functions work like normal. Importantly, the programmer's task shifts from solving concurrent data access problems to organizing data flow through functions. The resulting programs are easier to understand, easier to support, easier to extend, and unlock multi-core performance due to the ability to schedule behaviors to run efficiently across multiple processes.

BOC has been implemented in several languages, including as a foundational aspect of the research language Verona, and now has been implemented in Python.

Dive into the API