skip to main content
10.1145/2489837.2489841acmotherconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
research-article

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

Authors Info & Claims
Published:02 July 2013Publication History

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.

References

  1. Arvind and Thomas R. E.: I-Structures: An efficient data type for functional languages. Technical Report 210, MIT, Laboratory for Computer Science, Cambridge, MA (1980)Google ScholarGoogle Scholar
  2. Collet, R.: The Limits of Network Transparency in a Distributed Programming Language. PhD thesis, Université catholique de Louvain (2007)Google ScholarGoogle Scholar
  3. Doeraene S.: Ozma: Extending Scala with Oz Concurrency. Master's thesis, Université catholique de Louvain. Full source code available at https://github.com/sjrd/ozma (2011)Google ScholarGoogle Scholar
  4. Doeraene, S.: Ozma: Extending Scala with Oz Concurrency. Invited talk, Strange Loop, St Louis, MI, URL: thestrangeloop.com, (Sep. 2012)Google ScholarGoogle Scholar
  5. Drejhammar, F., Schulte, C., Haridi, S., Brand, P.: Flow Java: Declarative concurrency for Java. In Proceedings of the Nineteenth International Conference on Logic Programming, Springer LNCS, vol. 2916, pp. 346--360. (2003)Google ScholarGoogle ScholarCross RefCross Ref
  6. Halstead, R. H. Jr.: MultiLisp: A language for concurrent symbolic computation. In ACM Transactions on Programming Languages and Systems, 7(4), pp. 501--538 (Oct. 1985) Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Hewitt, C., Bishop P., Steiger, R.: A universal modular ACTOR formalism for artificial intelligence. In 3rd International Joint Conference on Artificial Intelligence (IJCAI), pp. 235--245 (Aug. 1973) Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Imam, S., Sarkar, V.: Habanero-Scala: Async-Finish Programming in Scala.Google ScholarGoogle Scholar
  9. Janson, S., Montelius, J., Haridi, S.: Ports for objects in concurrent logic programs. In Research Directions in Concurrent Object-Oriented Programming, pp. 211--231 (1993) Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Kahn, G.: The semantics of a simple language for parallel programming. In IFIP Congress, pp. 471--475 (1974)Google ScholarGoogle Scholar
  11. Odersky M.: Scala By Example. École Polytechnique Fédérale de Lausanne (2010)Google ScholarGoogle Scholar
  12. Odersky M.: The Scala language specification, version 2.9. École Polytechnique Fédérale de Lausanne (2011)Google ScholarGoogle Scholar
  13. Mozart Consortium: Mozart Programming System. URL: www.mozart-oz.org (2011)Google ScholarGoogle Scholar
  14. Programming Methods Laboratory: The Scala Programming Language. URL: www.scala-lang.org (2011)Google ScholarGoogle Scholar
  15. Rossberg, A.: Typed Open Programming: A Higher-Order, Typed Approach to Dynamic Modularity and Distribution. PhD thesis, Universität des Saarlandes (2007)Google ScholarGoogle Scholar
  16. Saraswat, V. A.: Concurrent Constraint Programming. MIT Press, Cambridge, MA (1993) Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Shapiro, E.: The family of concurrent logic programming languages. In ACM Computing Surveys, 21(3), pp. 413--510 (Sept. 1989) Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Smolka, G.: The Oz programming model. In Computer Science Today, Springer LNCS, vol. 1000, pp. 324--343 (1995)Google ScholarGoogle ScholarCross RefCross Ref
  19. Spiessens, A., Collet, R., Van Roy, R.: Declarative Laziness in a Concurrent Constraint Language. In 2nd International Workshop on Multiparadigm Constraint Programming Languages, part of 9th International Conference on Principles and Practice of Constraint Programming (CP2003) (Sep. 2003)Google ScholarGoogle Scholar
  20. Van Roy, P., Haridi, S.: Concepts, Techniques, and Models of Computer Programming. MIT Press, Cambridge MA (2004) Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Van Roy, P.: Ozma: Extending Scala with Oz Concurrency. Invited talk, QCon International Software Development Conference, San Francisco, CA, URL: qconsf.com, (Nov. 2011)Google ScholarGoogle Scholar

Index Terms

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

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in
            • Published in

              cover image ACM Other conferences
              SCALA '13: Proceedings of the 4th Workshop on Scala
              July 2013
              84 pages
              ISBN:9781450320641
              DOI:10.1145/2489837

              Copyright © 2013 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 2 July 2013

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              SCALA '13 Paper Acceptance Rate12of22submissions,55%Overall Acceptance Rate12of22submissions,55%

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader