A Generic Java Language Extension
Synchronous Communications and the Sieve of Eratosthenes
This page demonstrates a GJ package for synchronous communication via channels between threads. Interactions between processes are displayed on a message sequence chart. Thanks to GJ, channels can be of any type, and the GJ compiler checks that the message type conforms to the channel type. Heavy use is also made of the Java collection library.
The demonstration implements the Sieve of Eratosthenes, computing primes with a collection of concurrent processes. Pressing either again button re-executes the sieve, usually yielding a different interleaving of processes. In this example, most messages are of type Integer, but the `done' messages are of type String.
Comments and bug reports to the Pizza Group, firstname.lastname@example.org. Java is a trademark of Sun Microsystems. All software and documents on the Pizza site are © Copyright 1996, 1997 by the respective authors as attributed on each. Terms for redistribution are available.