Reactors: A Deterministic Model of Concurrent Computation for Reactive Systems

Marten Lohstroh

EECS Department
University of California, Berkeley
Technical Report No. UCB/EECS-2020-235
December 21, 2020

http://www2.eecs.berkeley.edu/Pubs/TechRpts/2020/EECS-2020-235.pdf

Actors have become widespread in programming languages and programming frameworks focused on parallel and distributed computing. While actors provide a more disciplined model for concurrency than threads, their interactions, if not constrained, admit nondeterminism. As a consequence, actor programs may exhibit unintended behaviors and are less amenable to rigorous testing. The same problem exists in other dominant concurrency models, such as threads, shared-memory models, publish-subscribe systems, and service-oriented architectures. We propose “reactors,” a new model of concurrent computation that combines synchronous-reactive principles with a sophisticated model of time to enable determinism while preserving much of the style and performance of actors. Reactors promote modularity and allow for distributed execution. The relationship that reactors establish between events across timelines allows for: 1. the construction of programs that react predictably to unpredictable external events; 2. the formulation of deadlines that grant control over timing; and 3. the preservation of a deterministic distributed execution semantics under quantifiable assumptions. We bring the deterministic concurrency and time-based semantics of reactors to the world of mainstream programming languages through Lingua Franca (LF), a polyglot coordination language with support (so far) for C, C++, Python, and TypeScript. In LF, program logic is given in one or more of those target languages, enabling developers to use familiar languages and integrate extensive libraries and legacy code. The main contributions of this work consist of a formalization of reactors, the implementation of an efficient runtime system for the execution of reactors, and the design and implementation of LF.

Advisor: Edward A. Lee


BibTeX citation:

@phdthesis{Lohstroh:EECS-2020-235,
    Author = {Lohstroh, Marten},
    Title = {Reactors: A Deterministic Model of Concurrent Computation for Reactive Systems},
    School = {EECS Department, University of California, Berkeley},
    Year = {2020},
    Month = {Dec},
    URL = {http://www2.eecs.berkeley.edu/Pubs/TechRpts/2020/EECS-2020-235.html},
    Number = {UCB/EECS-2020-235},
    Abstract = {Actors have become widespread in programming languages and programming frameworks focused on parallel and distributed computing. While actors provide a more disciplined model for concurrency than threads, their interactions, if not constrained, admit nondeterminism. As a consequence, actor programs may exhibit unintended behaviors and are less amenable to rigorous testing. The same problem exists in other dominant concurrency models, such as threads, shared-memory models, publish-subscribe systems, and service-oriented architectures.
We propose “reactors,” a new model of concurrent computation that combines synchronous-reactive principles with a sophisticated model of time to enable determinism while preserving much of the style and performance of actors. Reactors promote modularity and allow for distributed execution. The relationship that reactors establish between events across timelines allows for:
1. the construction of programs that react predictably to unpredictable external events;
2. the formulation of deadlines that grant control over timing; and
3. the preservation of a deterministic distributed execution semantics under quantifiable assumptions.
We bring the deterministic concurrency and time-based semantics of reactors to the world of mainstream programming languages through Lingua Franca (LF), a polyglot coordination language with support (so far) for C, C++, Python, and TypeScript. In LF, program logic is given in one or more of those target languages, enabling developers to use familiar languages and integrate extensive libraries and legacy code. The main contributions of this work consist of a formalization of reactors, the implementation of an efficient runtime system for the execution of reactors, and the design and implementation of LF.}
}

EndNote citation:

%0 Thesis
%A Lohstroh, Marten
%T Reactors: A Deterministic Model of Concurrent Computation for Reactive Systems
%I EECS Department, University of California, Berkeley
%D 2020
%8 December 21
%@ UCB/EECS-2020-235
%U http://www2.eecs.berkeley.edu/Pubs/TechRpts/2020/EECS-2020-235.html
%F Lohstroh:EECS-2020-235