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

Attached and detached closures in actors

Published: 05 November 2018 Publication 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.
[2]
Joe Armstrong, Robert Virding, Claes Wikström, and Mike Williams. 1993. Concurrent programming in Erlang. Prentice Hall.
[3]
Henry G. Baker and Carl Hewitt. 1977. The incremental garbage collection of processes. SIGART Newsletter 64 (1977), 55–59.
[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.
[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.
[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-00125034
[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.
[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.
[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.
[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.
[11]
Pony Developers. 2018. Pony – High-Performance Actor Programming. http://www.ponylang.org . (2018).
[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.
[13]
Lightbend Inc. 2018. AKKA – Scala actor library. http://akka.io/ . (2018).
[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.
[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.
[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
[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.
[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.
[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.
[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.
[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.
[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.

Cited By

View all
  • (2024)Encore: CodaActive Object Languages: Current Research Trends10.1007/978-3-031-51060-1_3(59-91)Online publication date: 29-Jan-2024
  • (2022)Portals: An Extension of Dataflow Streaming for Stateful ServerlessProceedings of the 2022 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3563835.3567664(153-171)Online publication date: 29-Nov-2022

Recommendations

Comments

Information & Contributors

Information

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
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].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 05 November 2018

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. closures
  2. concurrent programming
  3. parallel programming
  4. type systems

Qualifiers

  • Research-article

Conference

SPLASH '18
Sponsor:

Acceptance Rates

Overall Acceptance Rate 19 of 35 submissions, 54%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Encore: CodaActive Object Languages: Current Research Trends10.1007/978-3-031-51060-1_3(59-91)Online publication date: 29-Jan-2024
  • (2022)Portals: An Extension of Dataflow Streaming for Stateful ServerlessProceedings of the 2022 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software10.1145/3563835.3567664(153-171)Online publication date: 29-Nov-2022

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media