Professor Peter Welch
University of Kent at Canterbury
<phw@ukc.ac.ukl>
A serious problem with monitors (and their accompanying condition variables) is that to write and reason about one of its methods means having to write and reason about all its methods at the same time. This does not scale! As the complexity of the system we are trying to control grows, we get a combinatorial explosion in the logic required to implement that control. One of the great achievements of CSP is that this does not happen -- the semantics of each method are WYSIWIG (i.e. we can write and reason about each one separately). Yet all we are offered by Java are those monitors.
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 system complexity can be ramped up with linear increase in effort. 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 UK and the University of Twente in the Netherlands.
14 oktober 1997