Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

When Concurrency Matters: Behaviour-Oriented Concurrency

Published: 16 October 2023 Publication History

Abstract

Expressing parallelism and coordination is central for modern concurrent programming. Many mechanisms exist for expressing both parallelism and coordination. However, the design decisions for these two mechanisms are tightly intertwined. We believe that the interdependence of these two mechanisms should be recognised and achieved through a single, powerful primitive. We are not the first to realise this: the prime example is actor model programming, where parallelism arises through fine-grained decomposition of a program’s state into actors that are able to execute independently in parallel. However, actor model programming has a serious pain point: updating multiple actors as a single atomic operation is a challenging task. We address this pain point by introducing a new concurrency paradigm: Behaviour-Oriented Concurrency (BoC). In BoC, we are revisiting the fundamental concept of a behaviour to provide a more transactional concurrency model. BoC enables asynchronously creating atomic and ordered units of work with exclusive access to a collection of independent resources. In this paper, we describe BoC informally in terms of examples, which demonstrate the advantages of exclusive access to several independent resources, as well as the need for ordering. We define it through a formal model. We demonstrate its practicality by implementing a C++ runtime. We argue its applicability through the Savina benchmark suite: benchmarks in this suite can be more compactly represented using BoC in place of Actors, and we observe comparable, if not better, performance.

References

[1]
[n. d.]. Transactors. https://doc.akka.io/docs/akka/2.2/scala/transactors.html
[2]
Daniel J Abadi and Jose M Faleiro. 2018. An overview of deterministic database systems. Commun. ACM, 61, 9 (2018), 78–88. https://doi.org/10.1145/3181853
[3]
Gul A Agha. 1985. Actors: A model of concurrent computation in distributed systems. Massachusetts Inst of Tech Cambridge Artificial Intelligence Lab. https://doi.org/10.7551/mitpress/1086.001.0001
[4]
Developers AkkaSite. [n. d.]. Akka repo. https://akka.io/docs/
[5]
Gene M. Amdahl. 1967. Validity of the Single Processor Approach to Achieving Large Scale Computing Capabilities. In Proceedings of the April 18-20, 1967, Spring Joint Computer Conference (AFIPS ’67 (Spring)). Association for Computing Machinery, New York, NY, USA. 483–485. isbn:9781450378956 https://doi.org/10.1145/1465482.1465560
[6]
Ellen Arvidsson, Elias Castegren, Sylvan Clebsch, Sophia Drossopoulou, James Noble, Matthew J. Parkinson, and Tobias Wrigstad. 2023. Reference Capabilities for Flexible Memory Management. Proceedings of the ACM on Programming Languages, 7, OOPSLA2 (2023), https://doi.org/10.1145/3622846
[7]
Nick Benton, Luca Cardelli, and Cédric Fournet. 2002. Modern concurrency abstractions for C#. In European Conference on Object-Oriented Programming. 415–440. https://doi.org/10.1007/3-540-47993-7_18
[8]
Keren Bergman, Shekhar Borkar, Dan Campbell, William Carlson, William Dally, Monty Denneau, Paul Franzon, William Harrod, Kerry Hill, and Jon Hiller. 2008. Exascale computing study: Technology challenges in achieving exascale systems. Defense Advanced Research Projects Agency Information Processing Techniques Office (DARPA IPTO), Tech. Rep, 15 (2008), 181.
[9]
Philip A Bernstein. 2018. Actor-oriented database systems. In 2018 IEEE 34th International Conference on Data Engineering (ICDE). 13–14. https://doi.org/10.1109/icde.2018.00010
[10]
Sebastian Blessing, Sylvan Clebsch, and Sophia Drossopoulou. 2017. Tree topologies for causal message delivery. In Proceedings of the 7th ACM SIGPLAN International Workshop on Programming Based on Actors, Agents, and Decentralized Control. 1–10. https://doi.org/10.1145/3141834.3141835
[11]
Sebastian Blessing, Kiko Fernandez-Reyes, Albert Mingkun Yang, Sophia Drossopoulou, and Tobias Wrigstad. 2019. Run, actor, run: towards cross-actor language benchmarking. In Proceedings of the 9th ACM SIGPLAN International Workshop on Programming Based on Actors, Agents, and Decentralized Control. 41–50. https://doi.org/10.1145/3358499.3361224
[12]
Robert L Bocchino Jr, Vikram S Adve, Danny Dig, Sarita V Adve, Stephen Heumann, Rakesh Komuravelli, Jeffrey Overbey, Patrick Simmons, Hyojin Sung, and Mohsen Vakilian. 2009. A type and effect system for deterministic parallel Java. In Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications. 97–116. https://doi.org/10.1145/1639949.1640097
[13]
Zoran Budimlić, Michael Burke, Vincent Cavé, Kathleen Knobe, Geoff Lowney, Ryan Newton, Jens Palsberg, David Peixotto, Vivek Sarkar, and Frank Schlimbach. 2010. Concurrent collections. Scientific Programming, 18, 3-4 (2010), 203–217.
[14]
Developers CAFSite. [n. d.]. CAF repo. https://www.actor-framework.org
[15]
Vincent Cavé, Jisheng Zhao, Jun Shirako, and Vivek Sarkar. 2011. Habanero-Java: the new adventures of old X10. In Proceedings of the 9th International Conference on Principles and Practice of Programming in Java. 51–61. https://doi.org/10.1145/2093157.2093165
[16]
Luke Cheeseman, Matthew Parkinson, Slyvan Clebsch, Marios Kogias, Sophia Drossopoulou, David Chisnall, Tobias Wrigstad, and Paul Liétar. 2023. Artifact for "When Concurrency Matters: Behaviour Oriented Concurrency". https://doi.org/10.5281/zenodo.8320212
[17]
Dave Clarke and Tobias Wrigstad. 2003. External Uniqueness is Unique Enough. In European Conference of Object Oriented Programming. https://doi.org/10.1007/978-3-540-45070-2_9
[18]
S Clebsch. 2018. Pony: Co-designing a Type System and a Runtime. Ph. D. Dissertation. Ph. D. thesis, Imperial College London.
[19]
Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, and Andy McNeil. 2015. Deny Capabilities for safe, fast, actors. In Proceedings of the 7th ACM SIGPLAN International Workshop on Programming Based on Actors, Agents, and Decentralized Control. 1–10. https://doi.org/10.1145/2824815.2824816
[20]
S. Conchon and F. Le Fessant. 1999. Jocaml: mobile agents for Objective-Caml. In Proceedings. First and Third International Symposium on Agent Systems Applications, and Mobile Agents. 22–29. https://doi.org/10.1109/ASAMA.1999.805390
[21]
Joeri De Koster. 2015. Domains: Language abstractions for controlling shared mutable state in actor systems. Ph. D. Dissertation. PhD thesis, Vrije Universiteit Brussel.
[22]
Joeri De Koster, Tom Van Cutsem, and Theo D’Hondt. 2012. Domains: Safe sharing among actors. In Proceedings of the 2nd edition on Programming systems, languages and applications based on actors, agents, and decentralized control abstractions. 11–22. https://doi.org/10.1145/2414639.2414644
[23]
Thomas Dinsdale-Young, Lars Birkedal, Philippa Gardner, Matthew Parkinson, and Hongseok Yang. 2013. Views: Compositional Reasoning for Concurrent Programs. In Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’13). Association for Computing Machinery, New York, NY, USA. 287–300. isbn:9781450318327 https://doi.org/10.1145/2429069.2429104
[24]
Julian Dolby, Cristian Hammer, Daniel Marino, Frank Tip, Mandana Vaziri, and Jan Vitek. 2012. A Data-Centric Approach to Synchronization. TOPLAS, https://doi.org/10.1145/2160910.2160913
[25]
Kapali Eswaran, Jim Gray, Raymond A. Lorie, and Irving L. trainer. 1976. The Notions of Consistency and Predicate Locks in a Database System. Commun. ACM, 19, 11 (1976), 624–633. https://doi.org/10.1145/360363.360369
[26]
John Field and Carlos Varela. 2005. Transactors: a programming model for maintaining globally consistent distributed state in unreliable environments. In POPL. https://doi.org/10.1145/1040305.1040322
[27]
Cédric Fournet and Georges Gonthier. 1996. The reflexive CHAM and the join-calculus. In Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. 372–385. https://doi.org/10.1145/237721.237805
[28]
Cédric Fournet and Georges Gonthier. 2000. The join calculus: A language for distributed mobile programming. In International Summer School on Applied Semantics. 268–332. https://doi.org/10.1007/3-540-45699-6_6
[29]
Rati Gelashvili, Alexander Spiegelman, Zhuolun Xiang, George Danezis, Zekun Li, Yu Xia, Runtian Zhou, and Dahlia Malkhi. 2022. Block-STM: Scaling Blockchain Execution by Turning Ordering Curse to a Performance Blessing. arXiv preprint arXiv:2203.06871, https://doi.org/10.1145/3572848.3577524
[30]
Laure Gonnord, Ludovic Henrio, Lionel Morel, and Gabriel Radanne. 2022. A Survey on Parallelism and Determinism. ACM Computing Surveys (CSUR), https://doi.org/10.1145/3564529
[31]
Colin S Gordon, Matthew J Parkinson, Jared Parsons, Aleks Bromfield, and Joe Duffy. 2012. Uniqueness and reference immutability for safe parallelism. ACM SIGPLAN Notices, 47, 10 (2012), 21–40. https://doi.org/10.1145/2398857.2384619
[32]
Philip Haller and Martin Odersky. 2009. Scala actors: Unifying thread-based and actor-based programming. 202–220. https://doi.org/10.1016/j.tcs.2008.09.019
[33]
Tim Harris, Simon Marlow, and Simon Peyton Jones. 2005. Composable Memory Transactions. In PPoPP. ACM Press, 48–60. https://doi.org/10.1145/1065944.1065952
[34]
James W. Havender. 1968. Avoiding deadlock in multitasking systems. IBM systems journal, 7, 2 (1968), 74–84. https://doi.org/10.1147/sj.72.0074
[35]
Maurice Herlihy, Victor Luchangco, Mark Moir, and William N Scherer III. 2003. Software transactional memory for dynamic-sized data structures. In Proceedings of the twenty-second annual symposium on Principles of distributed computing. 92–101. https://doi.org/10.1145/872035.872048
[36]
Carl Hewitt, Peter Bishop, and Richard Steiger. 1973. Session 8 formalisms for artificial intelligence a universal modular actor formalism for artificial intelligence. In Advance Papers of the Conference. 3, 235.
[37]
Raphael Hiesgen, Dominik Charousset, and Thomas Schmidt. 2016. Reconsidering reliability in distributed actor systems. 31–32. https://doi.org/10.1145/2984043.2989218
[38]
Yihe Huang, William Qian, Eddie Kohler, Barbara Liskov, and Liuba Shrira. 2022. Opportunities for optimism in contended main-memory multicore transactions. The VLDB Journal, 1–23. https://doi.org/10.14778/3377369.3377373
[39]
Shams M Imam and Vivek Sarkar. 2014. 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. 67–80. https://doi.org/10.1145/2687357.2687368
[40]
Dan Kegel. 2014. The C10K problem. http://www.kegel.com/c10k.html
[41]
Eric Koskinen and Maurice Herlihy. 2008. Checkpoints and continuations instead of nested transactions. In Proceedings of the twentieth annual symposium on Parallelism in algorithms and architectures. 160–168. https://doi.org/10.1145/1378533.1378563
[42]
Peter Kraft, Fiodar Kazhamiaka, Peter Bailis, and Matei Zaharia. 2022. Data-Parallel Actors: A Programming Model for Scalable Query Serving Systems. In 19th USENIX Symposium on Networked Systems Design and Implementation (NSDI 22). USENIX Association, Renton, WA. 1059–1074. isbn:978-1-939133-27-4 https://www.usenix.org/conference/nsdi22/presentation/kraft
[43]
Tongping Liu, Charlie Curtsinger, and Emery D Berger. 2011. Dthreads: efficient deterministic multithreading. In Proceedings of the Twenty-Third ACM Symposium on Operating Systems Principles. 327–336. https://doi.org/10.1145/2043556.2043587
[44]
Alexander Matveev and Nir Shavit. 2012. Towards a fully pessimistic stm model. https://doi.org/10.1145/2486159.2486166
[45]
Michael D. McCool, Arch D. Robison, and James Reinders. 2012. Structured parallel programming patterns for efficient computation. isbn:9780124159938 0124159931 https://doi.org/10.1145/2382756.2382773
[46]
John M. Mellor-Crummey and Michael L. Scott. 1991. Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors. ACM Trans. Comput. Syst., 9, 1 (1991), feb, 21–65. issn:0734-2071 https://doi.org/10.1145/103727.103729
[47]
Katherine F. Moore and Dan Grossman. 2008. High-level small-step operational semantics of transactions. In POPL. ACM Press. https://doi.org/10.1145/1328438.1328448
[48]
Derek Murray, Frank McSherry, Rebecca Isaacs, Michael Isard, Paul Barham, and Martin Abadi. 2013. Naiad: A Timely Dataflow System. In Proceedings of the 24th ACM Symposium on Operating Systems Principles (SOSP) (proceedings of the 24th acm symposium on operating systems principles (sosp) ed.). ACM. https://doi.org/10.1145/2517349.2522738
[49]
Yang Ni, Vijay S Menon, Ali-Reza Adl-Tabatabai, Antony L Hosking, Richard L Hudson, J Eliot B Moss, Bratin Saha, and Tatiana Shpeisman. 2007. Open nesting in software transactional memory. In Proceedings of the 12th ACM SIGPLAN symposium on Principles and practice of parallel programming. 68–78. https://doi.org/10.1145/1229428.1229442
[50]
James Noble, Dave Clarke, and John Potter. 1998. Object Ownership for Dynamic Alias Protection. In OOPSLA. https://doi.org/10.1109/tools.1999.809424
[51]
Hubert Plociniczak and Susan Eisenbach. 2010. JErlang: Erlang with joins. In International Conference on Coordination Languages and Models. 61–75. https://doi.org/10.1007/978-3-642-13414-2_5
[52]
Developers PonySite. [n. d.]. Pony Github Repo. https://github.com/ponylang/
[53]
Dai Qin, Angela Demke Brown, and Ashvin Goel. 2021. Caracal: Contention Management with Deterministic Concurrency Control. In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles. 180–194. https://doi.org/10.1145/3477132.3483591
[54]
Bo Sang, Patrick Eugster, Gustavo Petri, Srivatsan Ravi, and Pierre-Louis Roman. 2020. Scalable and Serializable Networked Multi-Actor Programming. Proc. ACM Program. Lang., Article 198, nov, 30 pages. https://doi.org/10.1145/3428266
[55]
Bo Sang, Gustavo Petri, Masoud Saeida Ardekani, Srivatsan Ravi, and Patrick Eugster. 2016. Programming Scalable Cloud Services with AEON. In Proceedings of the 17th International Middleware Conference, Trento, Italy, December 12 - 16, 2016. ACM, 16. https://doi.org/10.1145/2988336.2988352
[56]
Jun Shirako, David M Peixotto, Vivek Sarkar, and William N Scherer. 2008. Phasers: a unified deadlock-free construct for collective and point-to-point synchronization. In Proceedings of the 22nd annual international conference on Supercomputing. 277–288. https://doi.org/10.1145/1375527.1375568
[57]
Janwillem Swalens, Joeri De Koster, and Wolfgang De Meuter. 2021. Chocola: Composable Concurrency Language. ACM Transactions on Programming Languages and Systems (TOPLAS), 42, 4 (2021), 1–56. https://doi.org/10.1145/3427201
[58]
Samira Tasharofi, Peter Dinges, and Ralph E Johnson. 2013. Why do scala developers mix the actor model with other concurrency models? In ECOOP 2013–Object-Oriented Programming: 27th European Conference, Montpellier, France, July 1-5, 2013. Proceedings 27. 302–326. https://doi.org/10.1007/978-3-642-39038-8_13
[59]
Carlos Varela and Gul Agha. 2001. Programming dynamically reconfigurable open systems with SALSA. ACM SIGPLAN Notices, 36, 12 (2001), 20–34. https://doi.org/10.1145/583960.583964
[60]
Mandana Vaziri, Frank Tip, and Julian Dolby. 2006. Associating synchronization constraints with data in an object-oriented language. In Proceedings of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2006, Charleston, South Carolina, USA, January 11-13, 2006, J. Gregory Morrisett and Simon L. Peyton Jones (Eds.). ACM, 334–345. https://doi.org/10.1145/1111037.1111067
[61]
David W Walker. 1994. The design of a standard message passing interface for distributed memory concurrent computers. Parallel Comput., 20, 4 (1994), 657–673. issn:0167-8191 https://doi.org/10.1016/0167-8191(94)90033-7 Message Passing Interfaces
[62]
Adam Welc, Bratin Saha, and Ali-Reza Adl-Tabatabai. 2008. Irrevocable transactions and their applications. In SPAA. https://doi.org/10.1145/1378533.1378584
[63]
WhatsApp. 2012. 1 million is so 2011. https://blog.whatsapp.com/1-million-is-so-2011

Cited By

View all
  • (2023)Reference Capabilities for Flexible Memory ManagementProceedings of the ACM on Programming Languages10.1145/36228467:OOPSLA2(1363-1393)Online publication date: 16-Oct-2023

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 7, Issue OOPSLA2
October 2023
2250 pages
EISSN:2475-1421
DOI:10.1145/3554312
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution 4.0 International License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 16 October 2023
Published in PACMPL Volume 7, Issue OOPSLA2

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tag

  1. actors

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)6,276
  • Downloads (Last 6 weeks)161
Reflects downloads up to 18 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Reference Capabilities for Flexible Memory ManagementProceedings of the ACM on Programming Languages10.1145/36228467:OOPSLA2(1363-1393)Online publication date: 16-Oct-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media