Kilim: Isolation-Typed Actors for Java

(A Million Actors, Safe Zero-Copy Communication)
  • Sriram Srinivasan
  • Alan Mycroft
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5142)

Abstract

This paper describes Kilim, a framework that employs a combination of techniques to help create robust, massively concurrent systems in mainstream languages such as Java: (i) ultra-lightweight, cooperatively-scheduled threads (actors), (ii) a message-passing framework (no shared memory, no locks) and (iii) isolation-aware messaging.

Isolation is achieved by controlling the shape and ownership of mutable messages – they must not have internal aliases and can only be owned by a single actor at a time. We demonstrate a static analysis built around isolation type qualifiers to enforce these constraints.

Kilim comfortably scales to handle hundreds of thousands of actors and messages on modest hardware. It is fast as well – task-switching is 1000x faster than Java threads and 60x faster than other lightweight tasking frameworks, and message-passing is 3x faster than Erlang (currently the gold standard for concurrency-oriented programming).

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Armstrong, J.: Making Reliable Distributed Systems in the Presence of Software Errors. PhD thesis, The Royal Institute of Technology, Stockholm (2003)Google Scholar
  2. 2.
    Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent Programming in Erlang. Prentice-Hall, Englewood Cliffs (1996)Google Scholar
  3. 3.
    Adya, A., Howell, J., Theimer, M., Bolosky, W.J., Douceur, J.R.: Cooperative Task Management Without Manual Stack Management. In: USENIX Annual Technical Conference, General Track, pp. 289–302 (2002)Google Scholar
  4. 4.
    von Behren, R., Condit, J., Zhou, F., Necula, G., Brewer, E.: Capriccio: Scalable threads for Internet Services. In: 19th ACM Symposium on Operating Systems Principles (2003)Google Scholar
  5. 5.
    Bevin, G.: Rife, http://rifers.org
  6. 6.
    Boehm, H.J.: Threads cannot be implemented as a library. In: ACM Conf. on PLDI, pp. 261–268 (2005)Google Scholar
  7. 7.
    Boyapati, C., Lee, R., Rinard, M.C.: Ownership types for safe programming: preventing data races and deadlocks. In: Proc. of OOPSLA, pp. 211–230 (2002)Google Scholar
  8. 8.
    Boyapati, C., Liskov, B., Shrira, L.: Ownership types for object encapsulation. In: Proc. of ACM POPL, pp. 213–223 (2003)Google Scholar
  9. 9.
    Boyland, J., Noble, J., Retert, W.: Capabilities for sharing: A generalisation of uniqueness and read-only. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 2–27. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  10. 10.
    Boyland, J.: Alias burying: Unique Variables Without Destructive Reads. Softw. Pract. Exper. 31(6), 533–553 (2001)MATHCrossRefGoogle Scholar
  11. 11.
    Briot, J.P., Guerraoui, R., Löhr, K.P.: Concurrency and distribution in object-oriented programming. ACM Comput. Surv. 30(3), 291–329 (1998)CrossRefGoogle Scholar
  12. 12.
    Clarke, D.G., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: Proc. of OOPSLA, pp. 48–64 (1998)Google Scholar
  13. 13.
    Clarke, D., Wrigstad, T.: External uniqueness is unique enough. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 176–200. Springer, Heidelberg (2003)Google Scholar
  14. 14.
    Danaher, J.S., Lee, I.T.A., Leiserson, C.E.: Programming with exceptions in JCilk. Sci. Comput. Program. 63(2), 147–171 (2006)MATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    DeCandia, G., Hastorun, D., Jampani, M., Kakulapati, G., Lakshman, A., Pilchin, A., Sivasubramanian, S., Vosshall, P., Vogels, W.: Dynamo: Amazon’s Highly Available Key-value Store. In: SOSP, pp. 205–220 (2007)Google Scholar
  16. 16.
    Drossopoulou, S., Clarke, D., Noble, J.: Types for Hierarchic Shapes. In: Sestoft, P. (ed.) ESOP 2006 and ETAPS 2006. LNCS, vol. 3924, pp. 1–6. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  17. 17.
    Ennals, R., Sharp, R., Mycroft, A.: Linear types for Packet Processing. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 204–218. Springer, Heidelberg (2004)Google Scholar
  18. 18.
    Fähndrich, M., Aiken, M., Hawblitzel, C., Hodson, O., Hunt, G.C., Larus, J.R., Levi, S.: Language support for fast and reliable message-based communication in Singularity OS. In: Proc. of EuroSys (2006)Google Scholar
  19. 19.
    Foster, J.S., Terauchi, T., Aiken, A.: Flow-sensitive type qualifiers. In: ACM Conf. on PLDI, pp. 1–12 (2002)Google Scholar
  20. 20.
    Ganz, S.E., Friedman, D.P., Wand, M.: Trampolined style. In: ICFP, pp. 18–27 (1999)Google Scholar
  21. 21.
    Haack, C., Poll, E., Schäfer, J., Schubert, A.: Immutable objects for a Java-like language. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 347–362. Springer, Heidelberg (2007), http://www.cs.ru.nl/~chaack/papers/papers/imm-obj.pdf CrossRefGoogle Scholar
  22. 22.
    Haller, P., Odersky, M.: Event-based programming without inversion of control. In: Proc. Joint Modular Languages Conference. Springer, Heidelberg (2006)Google Scholar
  23. 23.
    Hoare, C.A.R.: Communicating sequential processes. Communications of the ACM 21(8), 666–677 (1978)MATHCrossRefMathSciNetGoogle Scholar
  24. 24.
    Hogg, J., Lea, D., Wills, A., de Champeaux, D., Holt, R.C.: The Geneva Convention on the treatment of object aliasing. OOPS Messenger 3(2), 11–16 (1992)CrossRefGoogle Scholar
  25. 25.
    JavaFlow: The Apache Software Foundation: http://jakarta.apache.org/commons/sandbox/javaflow
  26. 26.
    Kobayashi, N.: Quasi-linear types. In: Proc. of ACM POPL, pp. 29–42 (1999)Google Scholar
  27. 27.
    Lea, D.: A Java fork/join framework. In: Java Grande, pp. 36–43 (2000)Google Scholar
  28. 28.
    Milner, R.: Communicating and Mobile Systems: the π-calculus. Cambridge University Press, Cambridge (1999)Google Scholar
  29. 29.
    Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999)MATHGoogle Scholar
  30. 30.
    Pettyjohn, G., Clements, J., Marshall, J., Krishnamurthi, S., Felleisen, M.: Continuations from generalized stack inspection. In: ICFP, pp. 216–227 (2005)Google Scholar
  31. 31.
    Salcianu, A., Rinard, M.C.: A combined pointer and purity analysis for Java programs. In: MIT Technical Report MIT-CSAIL-TR-949 (2004)Google Scholar
  32. 32.
    Spring, J.H., Privat, J., Guerraoui, R., Vitek, J.: Streamflex: High-throughput stream programming in Java, 211–228 (2007)Google Scholar
  33. 33.
    Srinivasan, S.: A thread of one’s own. In: Workshop on New Horizons in Compilers (2006), http://www.cse.iitb.ac.in/~uday/NHC-06/advprogram.html
  34. 34.
    Tschantz, M.S., Ernst, M.D.: Javari: adding reference immutability to Java. In: Proc. of OOPSLA, pp. 211–230 (2005)Google Scholar
  35. 35.
  36. 36.
    Welsh, M., Culler, D.E., Brewer, E.A.: SEDA: An architecture for well-conditioned, scalable internet services. In: SOSP, 230–243 (2001)Google Scholar
  37. 37.
    Wilhelm, R., Sagiv, S., Reps, T.W.: Shape analysis. In: Watt, D.A. (ed.) CC 2000 and ETAPS 2000. LNCS, vol. 1781, pp. 1–17. Springer, Heidelberg (2000)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Sriram Srinivasan
    • 1
  • Alan Mycroft
    • 1
  1. 1.University of Cambridge Computer LaboratoryCambridgeUK

Personalised recommendations