JCoBox: Generalizing Active Objects to Concurrent Components

  • Jan Schäfer
  • Arnd Poetzsch-Heffter
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6183)


Concurrency in object-oriented languages is still waiting for a satisfactory solution. For many application areas, standard mechanisms like threads and locks are too low level and have shown to be error-prone and not modular enough. Lately the actor paradigm has regained attention as a possible solution to concurrency in OOLs.

We propose JCoBox: a Java extension with an actor-like concurrency model based on the notion of concurrently running object groups, so-called coboxes. Communication is based on asynchronous method calls with standard objects as targets. Cooperative multi-tasking within coboxes allows for combining active and reactive behavior in a simple and safe way. Futures and promises lead to a data-driven synchronization of tasks.

This paper describes the concurrency model, the formal semantics, and the implementation of JCoBox, and shows that the performance of the implementation is comparable to state-of-the-art actor-based language implementations for the JVM.


Active Object Standard Object Dynamic Semantic Concurrency Model Thread Pool 
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.
    Ábrahám, E., Grabe, I., Grüner, A., Steffen, M.: Behavioral interface description of an object-oriented language with futures and promises. Journal of Logic and Algebraic Programming 78(7), 491–518 (2009)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Ábrahám, E., Grüner, A., Steffen, M.: Abstract interface behavior of object-oriented languages with monitors. Theor. Comput. Sci. 43(3), 322–361 (2008)zbMATHCrossRefGoogle Scholar
  3. 3.
    Agha, G.: Actors: a model of concurrent computation in distributed systems. MIT Press, Cambridge (1986)Google Scholar
  4. 4.
    America, P.: Issues in the design of a parallel object-oriented language. Form. Asp. Comput. 1(4), 366–411 (1989)CrossRefGoogle Scholar
  5. 5.
    Andrews, G.R., Coffin, M., Elshoff, I., Nilson, K., Townsend, G., Olsson, R.A., Purdin, T.: An overview of the SR language and implementation. TOPLAS 10(1), 51–86 (1988)CrossRefGoogle Scholar
  6. 6.
    Armstrong, J.: Making reliable distributed systems in the presence of software errors. Ph.D. thesis, The Royal Institute of Technology, Stockholm, Sweden (2003)Google Scholar
  7. 7.
    Baduel, L., Baude, F., Caromel, D., Contes, A., Huet, F., Morel, M., Quilici, R.: Programming, deploying, composing, for the Grid. In: Cunha, J.C., Rana, O.F. (eds.) Grid Computing: Software Environments and Tools. Springer, Heidelberg (January 2006)Google Scholar
  8. 8.
    Baker Jr., H.G., Hewitt, C.: The incremental garbage collection of processes. In: Proceedings of the 1977 symposium on Artificial intelligence and programming languages, pp. 55–59. ACM, New York (August 1977)CrossRefGoogle Scholar
  9. 9.
    Benton, N., Cardelli, L., Fournet, C.: Modern concurrency abstractions for C#. In: Magnusson, B. (ed.) ECOOP 2002. LNCS, vol. 2374, pp. 415–440. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  10. 10.
    Bloom, B., Field, J., Nystrom, N., Östlund, J., Richards, G., Strniša, R., Vitek, J., Wrigstad, T.: Thorn: robust, concurrent, extensible scripting on the JVM. SIGPLAN Not. 44(10), 117–136 (2009)CrossRefGoogle Scholar
  11. 11.
    de Boer, F.S., Clarke, D., Johnsen, E.B.: A complete guide to the future. In: Nicola, R.D. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 316–330. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  12. 12.
    Briot, J.P., Guerraoui, R., Lohr, K.P.: Concurrency and distribution in object-oriented programming. ACM Comput. Surv. 30(3), 291–329 (1998)CrossRefGoogle Scholar
  13. 13.
    Caromel, D.: Towards a method of object-oriented concurrent programming. Communications of the ACM 36(9), 90–102 (1993)CrossRefGoogle Scholar
  14. 14.
    Caromel, D., Henrio, L., Serpette, B.P.: Asynchronous and deterministic objects. In: Jones, N.D., Leroy, X. (eds.) POPL, pp. 123–134. ACM, New York (2004)CrossRefGoogle Scholar
  15. 15.
    Caromel, D., Mateu, L., Pothier, G., Tanter, É.: Parallel object monitors. Concurrency and Computation: Practice and Experience 20(12), 1387–1417 (2008)CrossRefGoogle Scholar
  16. 16.
    Caromel, D., Mateu, L., Tanter, É.: Sequential object monitors. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 317–341. Springer, Heidelberg (2004)Google Scholar
  17. 17.
    Clarke, D., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA, pp. 48–64. ACM Press, New York (October 1998)Google Scholar
  18. 18.
    Clarke, D., Wrigstad, T., Östlund, J., Johnsen, E.B.: Minimal ownership for active objects. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 139–154. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  19. 19.
    Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.L. (eds.): All About Maude - A High-Performance Logical Framework, How to Specify, Program and Verify Systems in Rewriting Logic. LNCS, vol. 4350. Springer, Heidelberg (2007)zbMATHGoogle Scholar
  20. 20.
    Creeger, M.: Multicore cpus for the masses. Queue 3(7), 64–ff (2005)Google Scholar
  21. 21.
    Fähndrich, M., Aiken, M., Hawblitzel, C., Hodson, O., Hunt, G., Larus, J.R., Levi, S.: Language support for fast and reliable message-based communication in Singularity OS. SIGOPS Oper. Syst. Rev. 40(4), 177–190 (2006)CrossRefGoogle Scholar
  22. 22.
    Felleisen, M., Hieb, R.: The revised report on the syntactic theories of sequential control and state. Theor. Comput. Sci. 103(2), 235–271 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  23. 23.
    Fischer, J., Majumdar, R., Millstein, T.: Tasks: language support for event-driven programming. In: Ramalingam, G., Visser, E. (eds.) PEPM, pp. 134–143. ACM, New York (2007)Google Scholar
  24. 24.
    Flatt, M., Krishnamurthi, S., Felleisen, M.: A programmer’s reduction semantics for classes and mixins. In: Alves-Foss, J. (ed.) Formal Syntax and Semantics of Java. LNCS, vol. 1523, pp. 241–269. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  25. 25.
    Fournet, C., Gonthier, G.: The reflexive CHAM and the join-calculus. In: POPL, pp. 372–385. ACM, New York (January 1996)Google Scholar
  26. 26.
    Georges, A., Buytaert, D., Eeckhout, L.: Statistically rigorous Java performance evaluation. In: Gabriel, R.P., Bacon, D.F., Lopes, C.V., Steele Jr., G.L. (eds.) OOPSLA, pp. 57–76. ACM, New York (2007)Google Scholar
  27. 27.
    Haack, C., Poll, E.: Type-based object immutability with flexible initialization. In: Drossopoulou, S. (ed.) ECOOP 2009 – Object-Oriented Programming. LNCS, vol. 5653, pp. 520–545. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  28. 28.
    Haack, C., Poll, E., Schäfer, J., Schubert, A.: Immutable objects for Java-like languages. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 347–362. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  29. 29.
    Haller, P., Odersky, M.: Scala actors: Unifying thread-based and event-based programming. Theor. Comput. Sci. 410(2-3), 202–220 (2009)zbMATHCrossRefMathSciNetGoogle Scholar
  30. 30.
    Halstead Jr., R.H.: Multilisp: a language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7(4), 501–538 (1985)zbMATHCrossRefGoogle Scholar
  31. 31.
    Hasselbring, W.: Programming languages and systems for prototyping concurrent applications. ACM Comput. Surv. 32(1), 43–79 (2000)CrossRefGoogle Scholar
  32. 32.
    Haustein, M., Löhr, K.P.: Jac: declarative Java concurrency. Concurrency and Computation: Practice and Experience 18(5), 519–546 (2006)CrossRefGoogle Scholar
  33. 33.
    Hewitt, C., Bishop, P., Steiger, R.: A universal modular ACTOR formalism for artificial intelligence. In: IJCAI, pp. 235–245. William Kaufmann, San Francisco (August 1973)Google Scholar
  34. 34.
    Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: A minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23(3), 396–450 (2001)CrossRefGoogle Scholar
  35. 35.
    JCoBox website (2010),
  36. 36.
  37. 37.
    Johnsen, E.B., Owe, O.: An asynchronous communication model for distributed concurrent objects. Software and Systems Modeling 6(1), 35–58 (2007)Google Scholar
  38. 38.
    Karmani, R.K., Shali, A., Agha, G.: Actor frameworks for the JVM platform: a comparative analysis. In: PPPJ, pp. 11–20. ACM, New York (2009)CrossRefGoogle Scholar
  39. 39.
    Keen, A.W., Ge, T., Maris, J.T., Olsson, R.A.: JR: Flexible distributed programming in an extended java. ACM Trans. Program. Lang. Syst. 26(3), 578–608 (2004)CrossRefGoogle Scholar
  40. 40.
    Lea, D.: A Java fork/join framework. In: JAVA 2000: Proceedings of the ACM 2000 conference on Java Grande, pp. 36–43. ACM, New York (2000)CrossRefGoogle Scholar
  41. 41.
    Leijen, D., Schulte, W., Burckhardt, S.: The design of a task parallel library. SIGPLAN Not. 44(10), 227–242 (2009)CrossRefGoogle Scholar
  42. 42.
    Lieberman, H.: Concurrent object-oriented programming in Act 1. In: Yonezawa, A., Tokoro, M. (eds.) Object-Oriented Concurrent Programming, pp. 9–36. MIT Press, Cambridge (1987)Google Scholar
  43. 43.
    Liskov, B., Shrira, L.: Promises: Linguistic support for efficient asynchronous procedure calls in distributed systems. In: PLDI, pp. 260–267 (1988)Google Scholar
  44. 44.
    Miller, M.S., Tribble, E.D., Shapiro, J.S.: Concurrency among strangers. In: De Nicola, R., Sangiorgi, D. (eds.) TGC 2005. LNCS, vol. 3705, pp. 195–229. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  45. 45.
    Morris, B.: Cactive and friends. Symbian Developer Network (June 2008)Google Scholar
  46. 46.
    Niehren, J., Schwinghammer, J., Smolka, G.: A concurrent lambda calculus with futures. Theor. Comput. Sci. 364(3), 338–356 (2006)zbMATHCrossRefMathSciNetGoogle Scholar
  47. 47.
    Nierstrasz, O.M.: Active objects in Hybrid. In: OOPSLA, pp. 243–253. ACM Press, New York (1987)Google Scholar
  48. 48.
    Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: An extensible compiler framework for Java. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  49. 49.
    Ousterhout, J.: Why threads are a bad idea (for most purposes) (1996), invited talk at the 1996 USENIX ConferenceGoogle Scholar
  50. 50.
    Philippsen, M.: A survey of concurrent object-oriented languages. Concurrency – Practice and Experience 12(10), 917–980 (2000)zbMATHCrossRefGoogle Scholar
  51. 51.
    Polyglot website (March 2010),
  52. 52.
    Rausch, A., Reussner, R., Plasil, F., Mirandola, R. (eds.): The Common Component Modeling Example: Comparing Software Component Models. LNCS, vol. 5153. Springer, Heidelberg (2008)Google Scholar
  53. 53.
    Rodriguez, N., Rossetto, S.: Integrating remote invocations with asynchronism and cooperative multitasking. Parallel Processing Letters 18(1), 71–85 (2008)CrossRefMathSciNetGoogle Scholar
  54. 54.
    Schäfer, J., Poetzsch-Heffter, A.: CoBoxes: Unifying active objects and structured heaps. In: Barthe, G., de Boer, F.S. (eds.) FMOODS 2008. LNCS, vol. 5051, pp. 201–219. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  55. 55.
    Srinivasan, S., Mycroft, A.: Kilim: Isolation-typed actors for java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 104–128. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  56. 56.
    Sutter, H.: The free lunch is over: A fundamental turn toward concurrency in software. Dr. Dobb’s Journal 30(3) (March 2005)Google Scholar
  57. 57.
    The computer language benchmarks game,
  58. 58.
    The Java RMI Specification (December 2009),
  59. 59.
    The OSGi specification release 4 version 4.2 (September 2009),
  60. 60.
    Van Cutsem, T., Mostinckx, S., Boix, E.G., Dedecker, J., Meuter, W.D.: Ambienttalk: Object-oriented event-driven programming in mobile ad hoc networks. In: SCCC, pp. 3–12. IEEE Computer Society, Los Alamitos (2007)Google Scholar
  61. 61.
    Yonezawa, A., Briot, J.P., Shibayama, E.: Object-oriented concurrent programming ABCL/1. In: Meyrowitz, N. (ed.) OOPSLA, pp. 258–268. ACM Press, New York (1986)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Jan Schäfer
    • 1
  • Arnd Poetzsch-Heffter
    • 1
  1. 1.University of Kaiserslautern 

Personalised recommendations