db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
%T Java Threads in Light of occam/CSP (Tutorial)
db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
%A Peter H. Welch
db_connect: Could not connect to paper db at "wotug@dragon.kent.ac.uk"
%E Andr\[`e] W. P. Bakkers
%B Proceedings of WoTUG\-20: Parallel Programming and Java
%X 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 contepts of threads and monitors. Monitors
were developed by Tony Hoare in the early 1970s as a
structued 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 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, Jav 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 occured,
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.)