A pure actor implementation of futures: A solution to mixing of concurrency models in Scala
Date
2024-09-17
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
ORCID
0009-0000-8269-797X
Type
Thesis
Degree Level
Masters
Abstract
This thesis presents a novel future-like library implemented using the pure Actor Model in Scala. Motivated by the challenges and potential pitfalls of mixing concurrency models in Scala, particularly the risks associated with integrating futures and actors. While both the Future and the Actor Model offer asynchronous programming and non-blocking execution, their integration can increase the risk of issues such as deadlocks and data races. This work focuses on the specific interaction between these two paradigms.
The project explores the mechanisms of futures and promises, proposing and implementing two distinct solutions. The first solution involves replacing futures and promises with task manager actors and worker actors. The second solution, which forms the basis of the final implementation, integrates futures with actors through a task abstraction and a result collection mechanism. The library is further extended with a partial implementation for distributed task execution.
Through a series of experiments and implementations, this work demonstrates the feasibility and effectiveness of building a future-like library solely on the Actor Model. The resulting library offers a robust and efficient solution for task management in both local and distributed environments, potentially mitigating the risks associated with mixing concurrency models. This research contributes to the broader field of concurrent programming in Scala and provides a foundation for future work in actor-based task management.
Description
Keywords
Actor Model, Future, Scala, Concurrency Model
Citation
Degree
Master of Science (M.Sc.)
Department
Computer Science
Program
Computer Science