Actors That Unify Threads and Events

  • Philipp Haller
  • Martin Odersky
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4467)


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 implemented our approach on unmodified JVMs. Our programming model integrates well with the threading model of the underlying VM.


Virtual Machine Suspended Actor Event Handler Work Thread Task Queue 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Agha, G.A.: ACTORS: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge, Massachusetts (1986)Google Scholar
  2. 2.
    Armstrong, J.: Erlang — a survey of the language and its industrial applications. In: Proc. INAP, pp. 16–18 (October 1996)Google Scholar
  3. 3.
    Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent Programming in Erlang, 2nd edn. Prentice-Hall, Englewood Cliffs (1996)Google Scholar
  4. 4.
    Black, A., Carlsson, M., Jones, M., Kieburtz, R., Nordlander, J.: Timber: A programming language for real-time embedded systems (2002)Google Scholar
  5. 5.
    Briot, J.-P.: Actalk: A testbed for classifying and designing actor languages in the Smalltalk-80 environment. In: Proc. ECOOP, pp. 109–129 (1989)Google Scholar
  6. 6.
    Chin, B., Millstein, T.D.: Responders: Language support for interactive applications. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 255–278. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  7. 7.
    Cooper, E., Morrisett, G.: Adding Threads to Standard ML. Report CMU-CS-90-186, Carnegie-Mellon University (December 1990)Google Scholar
  8. 8.
    Cunningham, R., Kohler, E.: Making events less slippery with eel. In: Proc. HotOS. USENIX (June 2005)Google Scholar
  9. 9.
    Draves, R.P., Bershad, B.N., Rashid, R.F., Dean, R.W.: Using continuations to implement thread management and communication in operating systems. Operating Systems Review 25(5), 122–136 (1991)CrossRefGoogle Scholar
  10. 10.
    Dunkels, A., Grönvall, B., Voigt, T.: Contiki - A lightweight and flexible operating system for tiny networked sensors. In: LCN, pp. 455–462 (2004)Google Scholar
  11. 11.
    Emir, B., Odersky, M., Williams, J.: Matching Objects with Patterns. LAMP-Report 2006-006, EPFL, Lausanne, Switzerland (December 2006)Google Scholar
  12. 12.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Reading (1995)Google Scholar
  13. 13.
    Garbinato, B., Guerraoui, R., Hulaas, J., Monod, M., Spring, J.: Frugal Mobile Objects. Technical report, EPFL (2005)Google Scholar
  14. 14.
    Germain, G., Feeley, M., Monnier, S.: Concurrency oriented programming in Termite Scheme. In: Proc. Workshop on Scheme and Functional Programming (September 2006)Google Scholar
  15. 15.
    Haller, P., Odersky, M.: Event-based Programming without Inversion of Control. In: Lightfoot, D.E., Szyperski, C.A. (eds.) JMLC 2006. LNCS, vol. 4228, pp. 4–22. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  16. 16.
    Harris, T., Fraser, K.: Language support for lightweight transactions. In: OOPSLA, pp. 388–402 (2003)Google Scholar
  17. 17.
    Harris, T., Marlow, S., Jones, S.L.P., Herlihy, M.: Composable memory transactions. In: Proc. PPOPP, June 2005, pp. 48–60. ACM Press, New York (2005)Google Scholar
  18. 18.
    Haynes, C.T., Friedman, D.P.: Engines build process abstractions. In: Symp. Lisp and Functional Programming, August 1984, pp. 18–24. ACM Press, New York (1984)CrossRefGoogle Scholar
  19. 19.
    Hewitt, C.E.: Viewing controll structures as patterns of passing messages. Journal of Artificial Intelligence 8(3), 323–364 (1977)CrossRefGoogle Scholar
  20. 20.
    Lauer, H.C., Needham, R.M.: On the duality of operating system structures. Operating Systems Review 13(2), 3–19 (1979)CrossRefGoogle Scholar
  21. 21.
    Lea, D.: Concurrent Programming in Java. Addison-Wesley, Reading (1996)Google Scholar
  22. 22.
    Lea, D.: A java fork/join framework. In: Java Grande, pp. 36–43 (2000)Google Scholar
  23. 23.
    Lee, E.A.: The problem with threads. Technical Report UCB/EECS-2006-1, University of California, Berkeley (January 2006)Google Scholar
  24. 24.
    Levis, P., Culler, D.: Mate: A tiny virtual machine for sensor networks. In: Proc. ASPLOS (October 2002)Google Scholar
  25. 25.
    Li, P., Zdancewic, S.: A language-based approach to unifying events and threads. Technical report, University of Pennsylvania (April 2006)Google Scholar
  26. 26.
    Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. Addison-Wesley, Reading (1996)Google Scholar
  27. 27.
    Nyström, J.H., Trinder, P.W., King, D.J.: Evaluating distributed functional languages for telecommunications software. In: Proc. Workshop on Erlang, August 2003, pp. 1–7. ACM Press, New York (2003)CrossRefGoogle Scholar
  28. 28.
    Ousterhout, J.: Why threads are A bad idea (for most purposes). Invited talk at USENIX (January 1996)Google Scholar
  29. 29.
    Pai, V.S., Druschel, P., Zwaenepoel, W.: Flash: An efficient and portable Web server. In: Proc. USENIX, pp. 199–212 (June 1999)Google Scholar
  30. 30.
    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)CrossRefGoogle Scholar
  31. 31.
    Varela, C., Agha, G.: Programming dynamically reconfigurable open systems with SALSA. ACM SIGPLAN Notices 36(12), 20–34 (2001)CrossRefGoogle Scholar
  32. 32.
    von Behren, J.R., Condit, J., Brewer, E.A.: Why events are a bad idea (for high-concurrency servers). In: Proc. Hot OS, USENIX, pp. 19–24 (May 2003)Google Scholar
  33. 33.
    von Behren, J.R., Condit, J., Zhou, F., Necula, G.C., Brewer, E.A.: Capriccio: scalable threads for internet services. In: Proc. SOSP, pp. 268–281 (2003)Google Scholar
  34. 34.
    Wand, M.: Continuation-based multiprocessing. In: LISP Conference, pp. 19–28 (1980)Google Scholar
  35. 35.
    Welsh, M., Culler, D.E., Brewer, E.A.: SEDA: An architecture for well-conditioned, scalable internet services. In: Proc. SOSP, pp. 230–243 (2001)Google Scholar

Copyright information

© Springer Berlin Heidelberg 2007

Authors and Affiliations

  • Philipp Haller
    • 1
  • Martin Odersky
    • 1
  1. 1.Programming Methods Lab (LAMP), École Polytechnique Fédérale de Lausanne (EPFL), 1015 LausanneSwitzerland

Personalised recommendations