Session-Based Distributed Programming in Java

  • Raymond Hu
  • Nobuko Yoshida
  • Kohei Honda
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5142)


This paper demonstrates the impact of integrating session types and object-oriented programming, through their implementation in Java. Session types provide high-level abstraction for structuring a series of interactions in a concise syntax, and ensure type-safe communications between distributed peers. We present the first full implementation of a language and runtime for session-based distributed programming featuring asynchronous message passing, delegation, and session subtyping and interleaving, combined with class downloading and failure handling. The compilation-runtime framework of our language effectively maps session abstraction onto underlying transports and guarantees communication safety through static and dynamic session type checking. We have implemented two alternative mechanisms for performing distributed session delegation and prove their correctness. Benchmark results show session abstraction can be realised with low runtime overhead.


Travel Agency Type Check Session Type Communication Primitive Remote Method Invocation 
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.
  2. 2.
    Benton, N., Cardelli, L., Fournet, C.: Modern concurrency abstractions for C#. ACM Trans. Program. Lang. Syst. 26(5), 769–804 (2004)CrossRefGoogle Scholar
  3. 3.
    Carbone, M., Honda, K., Yoshida, N.: Structured Communication-Centred Programming for Web Services. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 2–17. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  4. 4.
    Carbone, M., Honda, K., Yoshida, N., Milner, R., Brown, G., Ross-Talbot, S.: A theoretical basis of communication-centred concurrent programming. Published in [6] (2006)Google Scholar
  5. 5.
    CCR: An Asynchronous Messaging Library for C#2.0,
  6. 6.
    W3C Web Services Choreography,
  7. 7.
    Collingbourne, P., Kelly, P.: Inference of session types from control flow. In: FESCA. ENTCS. Elsevier, Amsterdam (to appear, 2008)Google Scholar
  8. 8.
    Coppo, M., Dezani-Ciancaglini, M., Yoshida, N.: Asynchronous Session Types and Progress for Object-Oriented Languages. In: Bonsangue, M.M., Johnsen, E.B. (eds.) FMOODS 2007. LNCS, vol. 4468, pp. 1–31. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  9. 9.
    Corin, R., Denielou, P.-M., Fournet, C., Bhargavan, K., Leifer, J.: Secure Implementations for Typed Session Abstractions. In: CFS 2007. IEEE-CS Press, Los Alamitos (2007)Google Scholar
  10. 10.
    Dezani-Ciancaglini, M., Mostrous, D., Yoshida, N., Drossopoulou, S.: Session Types for Object-Oriented Languages. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 328–352. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  11. 11.
    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: EuroSys 2006. ACM SIGOPS, pp. 177–190 (2006)Google Scholar
  12. 12.
    Gay, S., Hole, M.: Subtyping for Session Types in the Pi-Calculus. Acta Informatica 42(2/3), 191–225 (2005)zbMATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type disciplines for structured communication-based programming. In: Hankin, C. (ed.) ESOP 1998 and ETAPS 1998. LNCS, vol. 1381, pp. 22–138. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  14. 14.
    Honda, K., Yoshida, N., Carbone, M.: Web Services, Mobile Processes and Types. The Bulletin of the European Association for Theoretical Computer Science February(91), 165–185 (2007)Google Scholar
  15. 15.
    Honda, K., Yoshida, N., Carbone, M.: Multiparty Asynchronous Session Types. In: POPL 2008, pp. 273–284. ACM Press, New York (2008)CrossRefGoogle Scholar
  16. 16.
  17. 17.
    Lin, C.-K., Black, A.P.: DirectFlow: A domain-specific language for information-flow systems. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 299–322. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  18. 18.
    Neubauer, M., Thiemann, P.: An Implementation of Session Types. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 56–70. Springer, Heidelberg (2004)Google Scholar
  19. 19.
    Occam-pi homepage,
  20. 20.
    Pierce, B.C., Turner, D.N.: Pict: A programming language based on the pi-calculus. In: Plotkin, G., Stirling, C., Tofte, M. (eds.) Proof, Language and Interaction: Essays in Honour of Robin Milner. MIT Press, Cambridge (2000)Google Scholar
  21. 21.
  22. 22.
    Sackman, M., Eisenbach, S.: Session types in Haskell, draft (2008)Google Scholar
  23. 23.
    Scribble Project homepage,
  24. 24.
    Sparkes, S.: Conversation with Steve Ross-Talbot. ACM Queue 4(2) (March 2006)Google Scholar
  25. 25.
    Spring, J.H., Privat, J., Guerraoui, R., Vitek, J.: StreamFlex: high-throughput stream programming in Java. In: OOPSLA, pp. 211–228. ACM Press, New York (2007)Google Scholar
  26. 26.
  27. 27.
    Takeuchi, K., Honda, K., Kubo, M.: An Interaction-based Language and its Typing System. In: Halatsis, C., Philokyprou, G., Maritsas, D., Theodoridis, S. (eds.) PARLE 1994. LNCS, vol. 817, pp. 398–413. Springer, Heidelberg (1994)Google Scholar
  28. 28.
    UNIFI. International Organization for Standardization ISO 20022 UNIversal Financial Industry message scheme (2002),
  29. 29.
    Welch, P., Barnes, F.: Communicating Mobile Processes: introducing occam-pi. In: Abdallah, A.E., Jones, C.B., Sanders, J.W. (eds.) Communicating Sequential Processes. LNCS, vol. 3525, pp. 175–210. Springer, Heidelberg (2005)Google Scholar
  30. 30.
    X10 homepage,

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Raymond Hu
    • 1
  • Nobuko Yoshida
    • 1
  • Kohei Honda
    • 2
  1. 1.Imperial College London 
  2. 2.Queen Mary, University of London 

Personalised recommendations