Fair Join Pattern Matching for Actors

Authors Philipp Haller , Ayman Hussein , Hernán Melgratti , Alceste Scalas , Emilio Tuosto



PDF
Thumbnail PDF

File

LIPIcs.ECOOP.2024.17.pdf
  • Filesize: 1.25 MB
  • 28 pages

Document Identifiers

Author Details

Philipp Haller
  • KTH Royal Institute of Technology, Stockholm, Sweden
Ayman Hussein
  • Technical University of Denmark, Lyngby, Denmark
Hernán Melgratti
  • University of Buenos Aires & Conicet, Argentina
Alceste Scalas
  • Technical University of Denmark, Lyngby, Denmark
Emilio Tuosto
  • Gran Sasso Science Institute, L'Aquila, Italy

Acknowledgements

This work was inspired by the group discussion on "Join patterns / synchronisation - the next generation" [Dezani et al., 2022] at the Dagstuhl Seminar 21372; we thank the organisers of the meeting and Schloss Dagstuhl - Leibniz Center for Informatics for making this work possible. We thank Omar Inverso for the technical support he provided for our experimental evaluation, Roland Kuhn for fruitful discussions on the shop floor use case, António Ravara for some useful suggestions, and Antoine Sébert for an implementation of join patterns using Scala 3 macros [Sébert, 2022]. We thank the anonymous reviewers for their comments and suggestions.

Cite AsGet BibTex

Philipp Haller, Ayman Hussein, Hernán Melgratti, Alceste Scalas, and Emilio Tuosto. Fair Join Pattern Matching for Actors. In 38th European Conference on Object-Oriented Programming (ECOOP 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 313, pp. 17:1-17:28, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ECOOP.2024.17

Abstract

Join patterns provide a promising approach to the development of concurrent and distributed message-passing applications. Several variations and implementations have been presented in the literature - but various aspects remain under-explored: in particular, how to specify a suitable notion of message matching, how to implement it correctly and efficiently, and how to systematically evaluate the implementation performance. In this work we focus on actor-based programming, and study the application of join patterns with conditional guards (i.e., the most expressive and challenging version of join patterns in literature). We formalise a novel specification of fair and deterministic join pattern matching, ensuring that older messages are always consumed if they can be matched. We present a stateful, tree-based join pattern matching algorithm and prove that it correctly implements our fair and deterministic matching specification. We present a novel Scala 3 actor library (called JoinActors) that implements our join pattern formalisation, leveraging macros to provide an intuitive API. Finally, we evaluate the performance of our implementation, by introducing a systematic benchmarking approach that takes into account the nuances of join pattern matching (in particular, its sensitivity to input traffic and complexity of patterns and guards).

Subject Classification

ACM Subject Classification
  • Software and its engineering → Formal language definitions
  • Software and its engineering → Domain specific languages
  • Software and its engineering → Concurrent programming languages
  • Software and its engineering → Distributed programming languages
  • Theory of computation → Process calculi
Keywords
  • Concurrency
  • join patterns
  • join calculus
  • actor model

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Gul A. Agha. ACTORS - a model of concurrent computation in distributed systems. In MIT Press series in artificial intelligence, 1986. Google Scholar
  2. Nick Benton, Luca Cardelli, and Cédric Fournet. Modern concurrency abstractions for C#. ACM Trans. Program. Lang. Syst., 26(5):769-804, 2004. URL: https://doi.org/10.1145/1018203.1018205.
  3. Oliver Bračevac, Nada Amin, Guido Salvaneschi, Sebastian Erdweg, Patrick Eugster, and Mira Mezini. Versatile event correlation with algebraic effects. Proc. ACM Program. Lang., 2(ICFP), July 2018. URL: https://doi.org/10.1145/3236762.
  4. Mariangiola Dezani, Roland Kuhn, Sam Lindley, and Alceste Scalas. Behavioural Types: Bridging Theory and Practice (Dagstuhl Seminar 21372). Dagstuhl Reports, 11(8):52-75, 2022. URL: https://doi.org/10.4230/DagRep.11.8.52.
  5. Fabrice Le Fessant and Luc Maranget. Compiling join-patterns. Electronic Notes in Theoretical Computer Science, 16(3):205-224, 1998. URL: https://doi.org/10.1016/S1571-0661(04)00143-4.
  6. Charles Forgy. Rete: a fast algorithm for the many pattern/many object pattern match problem. Expert Systems, pages 324-341, 1991. Google Scholar
  7. Cédric Fournet, Fabrice Le Fessant, Luc Maranget, and Alan Schmitt. Jocaml: A language for concurrent distributed and mobile programming. In Johan Jeuring and Simon L. Peyton Jones, editors, Advanced Functional Programming, 4th International School, AFP 2002, Oxford, UK, August 19-24, 2002, Revised Lectures, volume 2638 of Lecture Notes in Computer Science, pages 129-158. Springer, 2002. URL: https://doi.org/10.1007/978-3-540-44833-4_5.
  8. Cédric Fournet and Georges Gonthier. The reflexive CHAM and the join-calculus. In Hans-Juergen Boehm and Guy L. Steele Jr., editors, Conference Record of POPL'96: The 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Papers Presented at the Symposium, St. Petersburg Beach, Florida, USA, January 21-24, 1996, pages 372-385. ACM Press, 1996. URL: https://doi.org/10.1145/237721.237805.
  9. Cédric Fournet, Georges Gonthier, Jean-Jacques Lévy, Luc Maranget, and Didier Rémy. A calculus of mobile agents. In CONCUR'96: Concurrency Theory: 7th International Conference Pisa, Italy, August 26-29, 1996 Proceedings 7, pages 406-421. Springer, 1996. Google Scholar
  10. Rosita Gerbo and Luca Padovani. Concurrent Typestate-Oriented Programming in Java. In Francisco Martins and Dominic Orchard, editors, Proceedings Programming Language Approaches to Concurrency- and Communication-cEntric Software, PLACES@ETAPS 2019, Prague, Czech Republic, 7th April 2019, volume 291 of EPTCS, pages 24-34, 2019. URL: https://doi.org/10.4204/EPTCS.291.3.
  11. Rob Van Glabbeek and Peter Höfner. Progress, justness, and fairness. ACM Comput. Surv., 52(4), August 2019. URL: https://doi.org/10.1145/3329125.
  12. Philipp Haller and Tom Van Cutsem. Implementing joins using extensible pattern matching. In Doug Lea and Gianluigi Zavattaro, editors, Coordination Models and Languages, 10th International Conference, COORDINATION 2008, Oslo, Norway, June 4-6, 2008. Proceedings, volume 5052 of Lecture Notes in Computer Science, pages 135-152. Springer, 2008. URL: https://doi.org/10.1007/978-3-540-68265-3_9.
  13. Shams M. Imam and Vivek Sarkar. Savina - an actor benchmark suite: Enabling empirical evaluation of actor libraries. In Proceedings of the 4th International Workshop on Programming Based on Actors Agents & Decentralized Control, AGERE! '14, pages 67-80, New York, NY, USA, 2014. Association for Computing Machinery. URL: https://doi.org/10.1145/2687357.2687368.
  14. G. Stewart Von Itzstein and Mark Jasiunas. On implementing high level concurrency in Java. In Amos Omondi and Stanislav Sedukhin, editors, Advances in Computer Systems Architecture, 8th Asia-Pacific Conference, ACSAC 2003, Aizu-Wakamatsu, Japan, September 23-26, 2003, Proceedings, volume 2823 of Lecture Notes in Computer Science, pages 151-165. Springer, 2003. URL: https://doi.org/10.1007/978-3-540-39864-6_13.
  15. Eryk Lagun. Evaluation and implementation of match algorithms for rule-based multi-agent systems using the example of jadex. MSc Thesis, University of Hamburg, 2009. URL: https://swa.informatik.uni-hamburg.de/files/abschlussarbeiten/Diplomarbeit_Eryk_Lagun.pdf.
  16. Qin Ma and Luc Maranget. Compiling pattern matching in join-patterns. In International Conference on Concurrency Theory, pages 417-431. Springer, 2004. URL: https://doi.org/10.1007/978-3-540-28644-8_27.
  17. Luc Maranget. Compiling pattern matching to good decision trees. In Eijiro Sumii, editor, Proceedings of the ACM Workshop on ML, 2008, Victoria, BC, Canada, September 21, 2008, pages 35-46. ACM, 2008. URL: https://doi.org/10.1145/1411304.1411311.
  18. Daniel P. Miranker. TREAT: a new and efficient match algorithm for AI production systems. PhD thesis, Columbia University, USA, 1987. UMI Order No. GAX87-10209. Google Scholar
  19. Martin Odersky. Functional nets. In European Symposium on Programming, pages 1-25. Springer, 2000. URL: https://doi.org/10.1007/3-540-46425-5_1.
  20. Hubert Plociniczak and Susan Eisenbach. Jerlang: Erlang with joins. In Coordination Models and Languages: 12th International Conference, COORDINATION 2010, Amsterdam, The Netherlands, June 7-9, 2010. Proceedings 12, pages 61-75. Springer, 2010. Google Scholar
  21. Humberto Rodriguez Avila. Orchestration of Actor-Based Languages for Cyber-Physical Systems. PhD thesis, Vrije Universiteit Brussel, 2021. Google Scholar
  22. Humberto Rodríguez-Avila, Joeri De Koster, and Wolfgang De Meuter. Advanced join patterns for the actor model based on CEP techniques. Art Sci. Eng. Program., 5(2):10, 2021. URL: https://doi.org/10.22152/programming-journal.org/2021/5/10.
  23. Claudio V. Russo. The Joins concurrency library. In Michael Hanus, editor, Practical Aspects of Declarative Languages, 9th International Symposium, PADL 2007, Nice, France, January 14-15, 2007, volume 4354 of Lecture Notes in Computer Science, pages 260-274. Springer, 2007. URL: https://doi.org/10.1007/978-3-540-69611-7_17.
  24. Claudio V. Russo. Join patterns for visual basic. In Gail E. Harris, editor, Proceedings of the 23rd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2008, October 19-23, 2008, Nashville, TN, USA, pages 53-72. ACM, 2008. URL: https://doi.org/10.1145/1449764.1449770.
  25. Antoine Louis Thibaut Sébert. Join-patterns for the actor model in Scala 3 using macros. Master’s thesis, DTU Department of Applied Mathematics and Computer Science, 2022. Available at URL: https://findit.dtu.dk/en/catalog/62f83d3680aa6403a4ccc0ab.
  26. Martin Sulzmann, Edmund S. L. Lam, and Peter Van Weert. Actors with multi-headed message receive patterns. In Doug Lea and Gianluigi Zavattaro, editors, Coordination Models and Languages, 10th International Conference, COORDINATION 2008, Oslo, Norway, June 4-6, 2008. Proceedings, volume 5052 of Lecture Notes in Computer Science, pages 315-330. Springer, 2008. URL: https://doi.org/10.1007/978-3-540-68265-3_20.
  27. Aaron Joseph Turon and Claudio V. Russo. Scalable join patterns. In Cristina Videira Lopes and Kathleen Fisher, editors, Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2011, part of SPLASH 2011, Portland, OR, USA, October 22 - 27, 2011, pages 575-594. ACM, 2011. URL: https://doi.org/10.1145/2048066.2048111.
  28. Louise Van Verre, Humberto Rodríguez-Avila, Jens Nicolay, and Wolfgang De Meuter. Florence: A hybrid logic-functional reactive programming language. Proceedings of the 9th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems, 2022. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail