Parallel Programming and Java conference
13 - 16 April 1997
Control Laboratory of the
University of Twente
the Netherlands

The conference will be held from 13 - 16 April, 1997.


Tutorial Programme

Java Threads in the light of occam/CSP

Communicating Java Threads Reference Manual

How tp Design Deadlock-Free Networks Using CSP and Verification Tools -- A Tutorial Introduction

Java Threads in the light of occam/CSP

Professor Peter Welch
University of Kent
Abstract. Java provides support for parallel computing through a model that is built into the language itself. However, the designers of Java chose to be fairly conservative and settled for the concepts of threads and monitors. Monitors were developed by Tony Hoare in the early 1970s as a structured way of using semaphores to control access to shared resources. Hoare moved away from this, in the late 1970s, to develop the theory of Communicating Sequential Processes (CSP). One reason for this was that the semantics of monitors and threads are not WYSIWIG, so that designing robust parallel algorithms at this level is seriously hard.

Fortunately, it is possible to introduce the CSP model into Java through sets of classes implemented on top of its monitor support. By restricting interaction between active Java objects to CSP synchronisation primitives, Java thread semantics become compositional and systems with arbitrary levels of complexity become possible. Multi-threaded Web applets and distributed applications become simpler to design and implement, race hazards never occur, difficulties such as starvation, deadlock and livelock are easier to confront and overcome, and performance is no worse than that obtained from directly using the raw monitor primitives.

The advantages of teaching parallelism in Java purely through the CSP class libraries will be discussed. (These libraries were developed jointly at Kent and Oxford Universities in the U.K. and the University of Twente in the Netherlands.)

Communicating Java Threads
Reference Manual

Gerald H. Hilderink

University of Twente

Abstract. This manual describes the use of channels and composition constructs for communicating threads in the programming language Java. We assume the reader of this manual is an experienced Java programmer. The code of which the interface is described in this manual is entirely written in Java. We see Java as a clear programming language so that the channel and composition constructs, as described in this reference manual, can be ported to other object-oriented languages, such as C++ or Smalltalk.

Channels are very close to the scheduler, in fact they may be part of the scheduler. Using channels allows scheduling on communication within the program and without any explicit command from the programmer. Scheduling based on communication results in a very fast non-pre-emptive scheduling algorithm that is faster than pre-emptive scheduling to ensure fair scheduling. The program will get better real-time characteristics and the scheduler of the Java Virtual Machine can be tuned for better performance for embedded systems.

Composition constructs provide a more easy way to build robust and better-structured concurrent programs. In chapter 2 the channel interface is described and in chapter 4 the use of the channel is described by three composition (communication) constructs: (1) the sequential communication construct, (2) the parallel communication construct, and (3) the alternative communication constructs. Chapter 5 describes several examples in terms of building blocks that illustrate the use of channels and composition constructs and by which simple concurrent programs can be built.

How to Design Deadlock-Free Networks
Using CSP
and Verification Tools -- A Tutorial

J.M.R.Martin and S.A.Jassim

Oxford University Computing Services,
13 Banbury Road,
Oxford 0X2 6NN, UK
Department of Mathematics,
Statistics, and Computer Science,
University of Buckingham,
MK18 1EG, UK
Abstract. The CSP language of C.A.R.Hoare originated as a blackboard mathematical notation for specifying and reasoning about parallel and distributed systems. More recently sophisticated tools have emerged which provide automated verification of CSP-specified systems. This has led to a tightening and standardisation of syntax. This paper outlines the syntax and semantics of CSP as it is now used and then describes how to design CSP networks, which are guaranteed to be free of deadlock, through a succession of increasingly complex worked examples, making use of the verification tool Deadlock Checker.