When Concurrency Matters: Behaviour-Oriented Concurrency

Proc. ACM Program. Lang. | , Vol 7(OOPSLA2)

Preprint

Expressing parallelism and coordination is central for modern concurrent programming. Many mechanisms
exist for expressing both parallelism and coordination. However, the design decisions for these two mechanisms
are tightly intertwined. We believe that the interdependence of these two mechanisms should be recognised
and achieved through a single, powerful primitive. We are not the first to realise this: the prime example
is actor model programming, where parallelism arises through fine-grained decomposition of a program’s
state into actors that are able to execute independently in parallel. However, actor model programming has a
serious pain point: updating multiple actors as a single atomic operation is a challenging task.

We address this pain point by introducing a new concurrency paradigm: Behaviour-Oriented Concurrency
(BoC). In BoC, we are revisiting the fundamental concept of a behaviour to provide a more transactional
concurrency model. BoC enables asynchronously creating atomic and ordered units of work with exclusive
access to a collection of independent resources.

In this paper, we describe BoC informally in terms of examples, which demonstrate the advantages of
exclusive access to several independent resources, as well as the need for ordering. We define it through a
formal model. We demonstrate its practicality by implementing a C++ runtime. We argue its applicability
through the Savina benchmark suite: benchmarks in this suite can be more compactly represented using BoC
in place of Actors, and we observe comparable, if not better, performance.