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.
This paper was developed from material first presented at the Java Threads Workshop. It presents the basic threads model of Java, discusses why they may be a good thing but why they need special care in their management, runs through the monitor mechanisms provided in Java for their control and points out weaknesses in that control. Finally, the CSP primitives are introduced and the case for ignoring the monitor methods presented.
@InProceedings{wotug21:light, author = {P.H. Welch}, title = {{Java Threads in the Light of occam/CSP}}, booktitle = {{Architectures, Languages and Patterns for Parallel and Distributed Applications (Proceedings of WoTUG-21)}}, editor = {P.H. Welch and A.W.P.Bakkers}, volume = 52, series = {Computer Systems Engineering Series}, year = 1998, publisher = {IOS Press (Amsterdam)}, month = {April}, note = {ISBN 90 5199 391 9} }