A new concurrency model for Scala based on a declarative dataflow core

  • Authors:
  • Sébastien Doeraene;Peter Van Roy

  • Affiliations:
  • École Polytechnique Fédérale de Lausanne, Lausanne, Switzerland;Université catholique de Louvain, Louvain-la-Neuve, Belgium

  • Venue:
  • Proceedings of the 4th Workshop on Scala
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Declarative dataflow values are single assignment variables such that all operations needing their values wait automatically until the values are available. Adding threads and declarative dataflow values to a functional language gives declarative concurrency, a model in which concurrency is deterministic and explicit synchronization is not needed. In our experience, this greatly simplifies the writing of concurrent programs (as explained in several chapters of CTM [20]). We complete this model with lazy execution and message-passing concurrency. Both extensions are tightly integrated with the declarative dataflow core. Lazy execution is provided by extending declarative dataflow with a by-need synchronization operation. Message passing is provided by adding streams equipped with a send operation, where a stream is a list with an unbound single-assignment variable. This paper presents the Ozma language, a conservative extension of Scala that supports all these concepts. We have made a complete implementation of Ozma by combining the implementations of Scala and Oz. Evaluation shows that this implementation supports the full semantics of Scala with concurrent programs based on the new concurrency model. In particular, within the functional subset of Scala the new concurrency model fully supports deterministic concurrency.