×

Scala actors: Unifying thread-based and event-based programming. (English) Zbl 1162.68396

Summary: There is an impedance mismatch between message-passing concurrency and virtual machines, such as the JVM. VMs usually map their threads to heavyweight OS processes. Without a lightweight process abstraction, users are often forced to write parts of concurrent applications in an event-driven style which obscures control flow, and increases the burden on the programmer.
In this paper we show how thread-based and event-based programming can be unified under a single actor abstraction. Using advanced abstraction mechanisms of the Scala programming language, we implement our approach on unmodified JVMs. Our programming model integrates well with the threading model of the underlying VM.

MSC:

68N19 Other programming paradigms (object-oriented, sequential, concurrent, automatic, etc.)
PDFBibTeX XMLCite
Full Text: DOI Link

References:

[1] Adya, Atul; Howell, Jon; Theimer, Marvin; Bolosky, William J.; Douceur, John R., Cooperative task management without manual stack management, (Proc. USENIX (2002), USENIX), 289-302
[2] Agha, Gul A., ACTORS: A Model of Concurrent Computation in Distributed Systems (1986), MIT Press: MIT Press Cambridge, Massachusetts
[3] Joe Armstrong, Erlang — a survey of the language and its industrial applications, in: Proc. INAP, October 1996, pp. 16-18; Joe Armstrong, Erlang — a survey of the language and its industrial applications, in: Proc. INAP, October 1996, pp. 16-18
[4] Armstrong, Joe; Virding, Robert; Wikström, Claes; Williams, Mike, Concurrent Programming in Erlang (1996), Prentice-Hall · Zbl 0869.68026
[5] Black, A.; Carlsson, M.; Jones, M.; Kieburtz, R.; Nordlander, J., Timber: A Programming Language for Real-Time Embedded Systems (2002)
[6] Blumofe, R., Cilk: An efficient multithreaded runtime system, Journal of Parallel and Distributed Computing, 37, 1, 55-69 (1996)
[7] Jean-Pierre Briot, Actalk: A testbed for classifying and designing actor languages in the Smalltalk-80 environment, in: Proc. ECOOP, 1989, pp. 109-129; Jean-Pierre Briot, Actalk: A testbed for classifying and designing actor languages in the Smalltalk-80 environment, in: Proc. ECOOP, 1989, pp. 109-129
[8] Caromel, D.; Delbé, C.; di Costanzo, A.; Leyton, M., ProActive: An integrated platform for programming and running applications on grids and P2P systems, Computational Methods in Science and Technology, 12, 1, 69-77 (2006)
[9] Caromel, Denis; Henrio, Ludovic; Serpette, Bernard Paul, Asynchronous and deterministic objects, (Proc. POPL (2004), ACM), 123-134 · Zbl 1325.68052
[10] Chin, Brian; Millstein, Todd D., Responders: Language support for interactive applications, (Proc. ECOOP. Proc. ECOOP, LNCS, vol. 4067 (July 2006), Springer), 255-278
[11] Claessen, Koen, A poor man’s concurrency monad, Journal of Functional Programming, 9, 3, 313-323 (1999) · Zbl 0948.68022
[12] Eric Cooper, Gregory Morrisett, Adding threads to standard ML, Report CMU-CS-90-186, Carnegie-Mellon University, December 1990; Eric Cooper, Gregory Morrisett, Adding threads to standard ML, Report CMU-CS-90-186, Carnegie-Mellon University, December 1990
[13] Cunningham, Ryan; Kohler, Eddie, Making events less slippery with eel, (Proc. HotOS (June 2005), USENIX)
[14] Van Cutsem, Tom; Dedecker, Jessie; Mostinckx, Stijn; Gonzalez Boix, Elisa; D’Hondt, Theo; De Meuter, Wolfgang, Ambient references: Addressing objects in mobile networks, (OOPSLA Companion (2006), ACM), 986-997
[15] Van Cutsem, Tom; Mostinckx, Stijn; De Meuter, Wolfgang, Linguistic symbiosis between actors and threads, (Proc. ICDL (2007), ACM), 222-248
[16] Dedecker, Jessie; Van Cutsem, Tom; Mostinckx, Stijn; D’Hondt, Theo; De Meuter, Wolfgang, Ambient-oriented programming in AmbientTalk, (Proc. ECOOP. Proc. ECOOP, LNCS, vol. 4067 (2006)), 230-254
[17] Draves, Richard P.; Bershad, Brian N.; Rashid, Richard F.; Dean, Randall W., Using continuations to implement thread management and communication in operating systems, Operating Systems Review, 25, 5, 122-136 (1991)
[18] Adam Dunkels, Björn Grönvall, Thiemo Voigt, Contiki — A lightweight and flexible operating system for tiny networked sensors, in: Proc. LCN, 2004, pp. 455-462; Adam Dunkels, Björn Grönvall, Thiemo Voigt, Contiki — A lightweight and flexible operating system for tiny networked sensors, in: Proc. LCN, 2004, pp. 455-462
[19] Emir, Burak; Odersky, Martin; Williams, John, Matching objects with patterns, (Ernst, Erik, Proc. ECOOP. Proc. ECOOP, LNCS, vol. 4609 (2007), Springer), 273-298
[20] Field, John; Varela, Carlos A., Transactors: A programming model for maintaining globally consistent distributed state in unreliable environments, (Proc. POPL (2005), ACM), 195-208 · Zbl 1369.68134
[21] Gamma, E.; Helm, R.; Johnson, R.; Vlissides, J., Design Patterns (1995), Addison-Wesley
[22] Benoit Garbinato, Rachid Guerraoui, Jarle Hulaas, Maxime Monod, Jesper Spring, Frugal mobile objects, Technical Report, EPFL, 2005; Benoit Garbinato, Rachid Guerraoui, Jarle Hulaas, Maxime Monod, Jesper Spring, Frugal mobile objects, Technical Report, EPFL, 2005
[23] Guillaume Germain, Marc Feeley, Stefan Monnier, Concurrency oriented programming in termite scheme, in: Proc. Workshop on Scheme and Functional Programming, September 2006; Guillaume Germain, Marc Feeley, Stefan Monnier, Concurrency oriented programming in termite scheme, in: Proc. Workshop on Scheme and Functional Programming, September 2006
[24] Haller, Philipp; Odersky, Martin, Event-based programming without inversion of control, (Proc. JMLC. Proc. JMLC, LNCS, vol. 4228 (September 2006), Springer), 4-22 · Zbl 1162.68396
[25] Tim Harris, Keir Fraser, Language support for lightweight transactions, in: Proc. OOPSLA, 2003, pp. 388-402; Tim Harris, Keir Fraser, Language support for lightweight transactions, in: Proc. OOPSLA, 2003, pp. 388-402
[26] Harris, Tim; Marlow, Simon; Peyton Jones, Simon L.; Herlihy, Maurice, Composable memory transactions, (Proc. PPOPP (June 2005), ACM), 48-60
[27] Haynes, Christopher T.; Friedman, Daniel P., Engines build process abstractions, (Symp. Lisp and Functional Programming (August 1984), ACM), 18-24
[28] Carl Hewitt, Peter Bishop, Richard Steiger, A universal modular ACTOR formalism for artificial intelligence, in: IJCAI, 1973, pp. 235-245; Carl Hewitt, Peter Bishop, Richard Steiger, A universal modular ACTOR formalism for artificial intelligence, in: IJCAI, 1973, pp. 235-245
[29] Lauer, Hugh C.; Needham, Roger M., On the duality of operating system structures, Operating Systems Review, 13, 2, 3-19 (1979)
[30] Lea, Doug, Concurrent Programming in Java (1996), Addison Wesley · Zbl 0888.68024
[31] Lea, Doug, A java fork/join framework, (Java Grande (2000)), 36-43
[32] Edward A. Lee, The problem with threads. Technical Report UCB/EECS-2006-1, University of California, Berkeley, January 2006; Edward A. Lee, The problem with threads. Technical Report UCB/EECS-2006-1, University of California, Berkeley, January 2006
[33] Li, Peng; Zdancewic, Steve, Combining events and threads for scalable network services implementation and evaluation of monadic, application-level concurrency primitives, (Proc. PLDI (2007), ACM), 189-199
[34] Lindholm, T.; Yellin, F., The Java Virtual Machine Specification (1996), Addison-Wesley
[35] Miller, Mark S.; Dean Tribble, E.; Shapiro, Jonathan, Concurrency among strangers — programming in E as plan coordination, (Proc. TGC 2005. Proc. TGC 2005, LNCS, vol. 3705 (2005), Springer-Verlag), 195-229
[36] Nyström, J. H.; Trinder, Philip W.; King, David J., Evaluating distributed functional languages for telecommunications software, (Proc. Workshop on Erlang (August 2003), ACM), 1-7
[37] John Ousterhout, Why threads are A bad idea (for most purposes), Invited talk at USENIX, January 1996; John Ousterhout, Why threads are A bad idea (for most purposes), Invited talk at USENIX, January 1996
[38] Vivek S. Pai, Peter Druschel, Willy Zwaenepoel, Flash: An efficient and portable Web server, in: Proc. USENIX, June 1999, pp. 199-212; Vivek S. Pai, Peter Druschel, Willy Zwaenepoel, Flash: An efficient and portable Web server, in: Proc. USENIX, June 1999, pp. 199-212
[39] Thomas, D. A.; Lalonde, W. R.; Duimovich, J.; Wilson, M.; McAffer, J.; Berry, B., Actra: A multitasking/multiprocessing smalltalk, ACM SIGPLAN Notices, 24, 4, 87-90 (1989)
[40] Varela, Carlos; Agha, Gul, Programming dynamically reconfigurable open systems with SALSA, ACM SIGPLAN Notices, 36, 12, 20-34 (2001)
[41] Robert von Behren, J.; Condit, Jeremy; Brewer, Eric A., Why events are a bad idea (for high-concurrency servers), (Proc. Hot OS (May 2003), USENIX), 19-24
[42] J. Robert von Behren, Jeremy Condit, Feng Zhou, George C. Necula, Eric A. Brewer, Capriccio: Scalable threads for internet services, in: Proc. SOSP, 2003, pp. 268-281; J. Robert von Behren, Jeremy Condit, Feng Zhou, George C. Necula, Eric A. Brewer, Capriccio: Scalable threads for internet services, in: Proc. SOSP, 2003, pp. 268-281
[43] Mitchell Wand, Continuation-based multiprocessing, in: LISP Conference, 1980, pp. 19-28; Mitchell Wand, Continuation-based multiprocessing, in: LISP Conference, 1980, pp. 19-28
[44] Matt Welsh, David E. Culler, Eric A. Brewer, SEDA: An architecture for well-conditioned, scalable internet services, in: Proc. SOSP, 2001, pp. 230-243; Matt Welsh, David E. Culler, Eric A. Brewer, SEDA: An architecture for well-conditioned, scalable internet services, in: Proc. SOSP, 2001, pp. 230-243
[45] Akinori Yonezawa, Jean-Pierre Briot, Etsuya Shibayama, Object-oriented concurrent programming in ABCL/1, in: Proc. OOPSLA, 1986, pp. 258-268; Akinori Yonezawa, Jean-Pierre Briot, Etsuya Shibayama, Object-oriented concurrent programming in ABCL/1, in: Proc. OOPSLA, 1986, pp. 258-268
[46] Ziarek, Lukasz; Schatz, Philip; Jagannathan, Suresh, Stabilizers: A modular checkpointing abstraction for concurrent functional programs, (Proc. ICFP (2006), ACM), 136-147
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.