Abstract
The execution of an application written in a reactive language involves transfer of data and control flow between imperative and reactive abstractions at well-defined points. In a multi-threaded environment, multiple such interactions may execute concurrently, potentially causing data races and event ordering ambiguities. Existing RP languages either disable multi-threading or handle it at the cost of reducing expressiveness or weakening consistency. This paper proposes a model for thread-safe reactive programming (RP) that ensures abort-free strict serializability under concurrency while sacrificing neither expressiveness nor consistency. We also propose an architecture for integrating a corresponding scheduler into the RP language runtime, such that thread-safety is provided "out-of-the-box" to the applications.
We show the feasibility of our proposal by providing and evaluating a ready-to-use implementation integrated into the REScala programming language. The scheduling algorithm is formally proven correct. A thorough empirical evaluation shows that reactive applications build on top of it scale with multiple threads, while the scheduler incurs acceptable performance overhead in a single-threaded configuration. The scalability enabled by our scheduler is roughly on-par with that of hand-crafted application-specific locking and better than the scalability enabled by a scheduler using an off-the-shelf software transactional memory library.
Funder
European Research Council
Deutsche Forschungsgemeinschaft
Hessisches Ministerium für Wissenschaft und Kunst
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
12 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. LoRe: A Programming Model for Verifiably Safe Local-first Software;ACM Transactions on Programming Languages and Systems;2024-01-15
2. Bridging Between Active Objects: Multitier Programming for Distributed, Concurrent Systems;Lecture Notes in Computer Science;2024
3. Historiographer: Strongly-Consistent Distributed Reactive Programming with Minimal Locking;Companion Proceedings of the 2023 ACM SIGPLAN International Conference on Systems, Programming, Languages, and Applications: Software for Humanity;2023-10-22
4. Implementation of Thread Local Storage Optimization Method Based on LoongArch;2023 42nd Chinese Control Conference (CCC);2023-07-24
5. Distributed Persistent Signals: Architecture and Implementation;Proceedings of the 9th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems;2022-11-29