Alting barriers: synchronisation with choice in Java using JCSP

Communicating Sequential Processes for Java (JCSP) is a mature library that implements CSP-derived concurrency primitives in Java. A JCSP system is a hierarchical network of autonomous processes communicating over synchronous (optionally buffered) channels, and multiway synchronising through barriers. This paper presents a significant extension to the barrier mechanism: the fast resolution of choice between any number of barrier events, channel communications (in either direction) and timeouts. Previously, and in line with all currently released libraries and languages offering the CSP concurrency model, choice was restricted to channel inputs and timeouts. The paper demonstrates an application of alting barriers and explains the mechanisms used in their implementation that enables their use as guards in a choice. It also shows how choice over channel outputs becomes possible, as a simple consequence of having choice over barriers. Finally, an efficient implementation of CSP's broadcasting channels is presented (using a phased barrier synchronisation pattern) and a mechanism for allowing choice over these is discussed. With this extended JCSP, almost all CSP-specified systems can now be directly implemented. The new library is available under LGPL open source. Copyright © 2010 PH Welch, NCC Brown, J Moores, KV Chalmers & B Sputh. Revised version of Welch PH, Brown NCC, Moores J, Chalmers KV, Sputh B. Integrating and extending JCSP. In McEwan AA, Schneider S, Ifill W, Welch PH (eds). Communicating Process Architectures 2007. IOS Press: Amsterdam. Published with permission from IOS Press.

[1]  Adam T. Sampson,et al.  Barrier Synchronisation for occam-pi , 2005, PDPTA.

[2]  Robin Milner,et al.  Communicating and mobile systems - the Pi-calculus , 1999 .

[3]  Alex A. Lehmberg,et al.  An Introduction to CSP.NET , 2006, CPA.

[4]  Peter H. Welch,et al.  A process-oriented architecture for complex system modelling , 2010 .

[5]  Johannes F. Broenink,et al.  Communicating threads for Java , 1999 .

[6]  Ana Cavalcanti,et al.  From Circus to JCSP , 2004, ICFEM.

[7]  Neil Brown,et al.  Integrating and Extending JCSP , 2007 .

[8]  Johannes F. Broenink,et al.  Redesign of the C++ Communicating Threads Library for Embedded Control Systems , 2004 .

[9]  S. T. Buckland,et al.  An Introduction to the Bootstrap. , 1994 .

[10]  Jeremy M. R. Martin,et al.  Formal Analysis of Concurrent Java Systems , 2000 .

[11]  Peter H. Welch,et al.  Mobile Barriers for occam-pi: Semantics, Implementation and Application , 2005, CPA.

[12]  Augusto Sampaio,et al.  JACK: A Framework for Process Algebra Implementation in Java , 2002, Anais do XVI Simpósio Brasileiro de Engenharia de Software (SBES 2002).

[13]  Fiona A. C. Polack,et al.  Communicating complex systems , 2006 .

[14]  Jim Woodcock,et al.  Using Circus for Safety-critical Applications , 2004, WMF.

[15]  C. A. R. Hoare,et al.  Communicating sequential processes , 1978, CACM.

[16]  Peter H. Welch A Fast Resolution of Choice between Multiway Synchronisations (Invited Talk) , 2006, CPA.

[17]  Sarah Clayton,et al.  CSP for .NET Based on JCSP , 2006, CPA.

[18]  Peter H. Welch,et al.  Process Oriented Design for Java: Concurrency for All , 2002, International Conference on Computational Science.

[19]  Andrew William Roscoe,et al.  The Theory and Practice of Concurrency , 1997 .

[20]  Neil Brown,et al.  C++CSP2: A Many-to-Many Threading Model for Multicore Architectures , 2007, CPA.

[21]  Peter H. Welch,et al.  CSP Networking for Java (JCSP.net) , 2002, International Conference on Computational Science.

[22]  Peter H. Welch,et al.  Communicating Mobile Processes , 2004, 25 Years Communicating Sequential Processes.