skip to main content
10.1145/3281366.3281371acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Attached and detached closures in actors

Published:05 November 2018Publication History

ABSTRACT

Expressive actor models combine aspects of functional programming into the pure actor model enriched with futures. Such functional features include first-class closures which can be passed between actors and chained on futures. Combined with mutable objects, this opens the door to race conditions. In some situations, closures may not be evaluated by the actor that created them yet may access fields or objects owned by that actor. In other situations, closures may be safely fired off to run as a separate task.

This paper discusses the problem of who can safely evaluate a closure to avoid race conditions, and presents the current solution to the problem adopted by the Encore language. The solution integrates with Encore's capability type system, which influences whether a closure is attached and must be evaluated by the creating actor, or whether it can be detached and evaluated independently of its creator.

Encore's current solution to this problem is not final or optimal. We conclude by discussing a number of open problems related to dealing with closures in the actor model.

References

  1. Gul Agha. 1986. Actors: a model of concurrent computation in distributed systems. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Joe Armstrong, Robert Virding, Claes Wikström, and Mike Williams. 1993. Concurrent programming in Erlang. Prentice Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Henry G. Baker and Carl Hewitt. 1977. The incremental garbage collection of processes. SIGART Newsletter 64 (1977), 55–59. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Frank De Boer, Vlad Serbanescu, Reiner Hähnle, Ludovic Henrio, Justine Rochas, Crystal Chang Din, Einar Broch Johnsen, Marjan Sirjani, Ehsan Khamespanah, Kiko Fernandez-Reyes, and Albert Mingkun Yang. 2017. A Survey of Active Object Languages. ACM Comput. Surv. 50, 5, Article 76 (Oct. 2017), 39 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Stephan Brandauer, Elias Castegren, Dave Clarke, Kiko FernandezReyes, Einar Broch Johnsen, Ka I Pun, S Lizeth Tapia Tarifa, Tobias Wrigstad, and Albert Mingkun Yang. 2015. Parallel Objects for Multicores: A Glimpse at the Parallel Language Encore. In Formal Methods for Multicore Programming, SFM 2015, M Bernardo and E B Johnsen (Eds.). Lecture Notes in Computer Science, Vol. 9104. Springer, 1–56.Google ScholarGoogle Scholar
  6. Denis Caromel, Christian Delbe, Alexandre Di Costanzo, and Mario Leyton. 2006. ProActive: an integrated platform for programming and running applications on grids and P2P systems. Computational Methods in Science and Technology 12 (2006), issue 1. https://hal. archives-ouvertes.fr/hal-00125034Google ScholarGoogle Scholar
  7. Elias Castegren, Joel Wallin, and Tobias Wrigstad. 2018. Bestow and Atomic: Concurrent Programming Using Isolation, Delegation and Grouping. Journal of Logical and Algebraic Methods in Programming 100 (2018), 130–151.Google ScholarGoogle ScholarCross RefCross Ref
  8. Elias Castegren and Tobias Wrigstad. 2016. Reference Capabilities for Concurrency Control. In 30th European Conference on ObjectOriented Programming, ECOOP 2016, July 18-22, 2016, Rome, Italy (LIPIcs), Shriram Krishnamurthi and Benjamin S. Lerner (Eds.), Vol. 56. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 5:1–5:26.Google ScholarGoogle Scholar
  9. Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, and Andy McNeil. 2015. Deny capabilities for safe, fast actors. In Proceedings of the 5th International Workshop on Programming Based on Actors, Agents, and Decentralized Control, AGERE! 2015, Pittsburgh, PA, USA, October 26, 2015, Elisa Gonzalez Boix, Philipp Haller, Alessandro Ricci, and Carlos Varela (Eds.). ACM, 1–12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jessie Dedecker, Tom Van Cutsem, Stijn Mostinckx, Theo D’Hondt, and Wolfgang De Meuter. 2006. Ambient-Oriented Programming in AmbientTalk. In ECOOP 2006 - Object-Oriented Programming, 20th European Conference, Nantes, France, July 3-7, 2006, Proceedings (Lecture Notes in Computer Science), Dave Thomas (Ed.), Vol. 4067. Springer, 230–254. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Pony Developers. 2018. Pony – High-Performance Actor Programming. http://www.ponylang.org . (2018).Google ScholarGoogle Scholar
  12. Kiko Fernandez-Reyes, Dave Clarke, Elias Castegren, and Huu-Phuc Vo. 2018. Forward to a Promising Future. In Coordination Models and Languages - 20th IFIP WG 6.1 International Conference, COORDINATION 2018, Held as Part of the 13th International Federated Conference on Distributed Computing Techniques, DisCoTec 2018, Madrid, Spain, June 18-21, 2018. Proceedings (Lecture Notes in Computer Science), Giovanna Di Marzo Serugendo and Michele Loreti (Eds.), Vol. 10852. Springer, 162–180.Google ScholarGoogle Scholar
  13. Lightbend Inc. 2018. AKKA – Scala actor library. http://akka.io/ . (2018).Google ScholarGoogle Scholar
  14. Einar Broch Johnsen, Reiner Hähnle, Jan Schäfer, Rudolf Schlatte, and Martin Steffen. 2010. ABS: A Core Language for Abstract Behavioral Specification. In Formal Methods for Components and Objects -9th International Symposium, FMCO 2010, Graz, Austria, November 29 - December 1, 2010. Revised Papers (Lecture Notes in Computer Science), Bernhard K. Aichernig, Frank S. de Boer, and Marcello M. Bonsangue (Eds.), Vol. 6957. Springer, 142–164. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Einar Broch Johnsen, Olaf Owe, and Ingrid Chieh Yu. 2006. Creol: A type-safe object-oriented model for distributed concurrent systems. Theor. Comput. Sci. 365, 1-2 (2006), 23–66. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. Greg Lavender and Douglas C. Schmidt. 1996. Pattern Languages of Program Design 2. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, Chapter Active Object: An Object Behavioral Pattern for Concurrent Programming, 483–499. http://dl.acm.org/citation. cfm?id=231958.232967 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Heather Miller, Philipp Haller, and Martin Odersky. 2014. Spores: A type-based foundation for closures in the age of concurrency and distribution. In European Conference on Object-Oriented Programming (Lecture Notes in Computer Science), Vol. 8586. Springer, 308–333. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Mark Samuel Miller. 2006. Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control. Ph.D. Dissertation. Johns Hopkins University, Baltimore, Maryland, USA.Google ScholarGoogle Scholar
  19. Samira Tasharofi, Peter Dinges, and Ralph E Johnson. 2013. Why do scala developers mix the actor model with other concurrency models?. In European Conference on Object-Oriented Programming (Lecture Notes in Computer Science), Vol. 7920. Springer, 302–326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Yannick Welsch, Jan Schäfer, and Arnd Poetzsch-Heffter. 2013. Location Types for Safe Programming with Near and Far References. In Aliasing in Object-Oriented Programming. Types, Analysis and Verification, Dave Clarke, James Noble, and Tobias Wrigstad (Eds.). Lecture Notes in Computer Science, Vol. 7850. Springer, 471–500. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Yasuhiko Yokote and Mario Tokoro. 1987. Concurrent Programming in ConcurrentSmalltalk. In Object-Oriented Concurrent Programming, Akinori Yonezawa and Mario Tokoro (Eds.). MIT Press, 129–158. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Akinori Yonezawa, Jean-Pierre Briot, and Etsuya Shibayama. 1986. Object-Oriented Concurrent Programming in ABCL/1. In Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’86), Portland, Oregon, Proceedings., Norman K. Meyrowitz (Ed.). ACM, 258–268. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Attached and detached closures in actors

      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 Conferences
        AGERE 2018: Proceedings of the 8th ACM SIGPLAN International Workshop on Programming Based on Actors, Agents, and Decentralized Control
        November 2018
        71 pages
        ISBN:9781450360661
        DOI:10.1145/3281366

        Copyright © 2018 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: 5 November 2018

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate19of35submissions,54%

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader