Alting barriers: synchronisation with choice in Java using JCSP

  • Authors:
  • Peter Welch;Neil Brown;James Moores;Kevin Chalmers;Bernhard Sputh

  • Affiliations:
  • Computing Laboratory, University of Kent, Canterbury, Kent, CT2 7NF, U.K.;Computing Laboratory, University of Kent, Canterbury, Kent, CT2 7NF, U.K.;23 Tunnel Avenue, London SE10 0SF, U.K.;School of Computing, Napier University, Edinburgh, EH10 5DT, U.K.;Department of Engineering, University of Aberdeen, Scotland, AB24 3UE, U.K.

  • Venue:
  • Concurrency and Computation: Practice & Experience - Communicating Process Architectures (CPA) 2007
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.