Dining Philosophers Screenshot Collection
Last updated on 11-10-29.
The Dining Philosophers application is Sun's implementation of the classic Dining Philosophers problem: [explain]. The source for this application can be found in our reference collection.
UI-- Concurrency
The Sequence Diagram above shows all philosophers with one grabbed chopstick. Note that Philosopher:4 (yellow) grabbed two chopsticks and released one already. Philosopher:5 (light blue) tries to grab the chopstick held by Philosopher:4 and must wait for the chopstick to be released. The temporal context (dashed line) shows an instant during Philosopher:4's release of the chopstick while Philosopher:5 waits for the chopstick to become available for grabbing.
The Object Diagram above corresponds to the temporal context of the earlier sequence diagram, where two methods execute concurrently within the same object context, namely, Chopstick:4. This is a major strength of JIVE-- no other visual tool provides such an intuitive view of concurrent method calls within the same object context.
UI-- Deadlock
All five philosophers with one hand raised waiting for a chopstick grabbed by another philosopher.
The Sequence Diagram above shows all philosophers with an outstanding call to grab and, above each outstanding call, an earlier successful call to grab on the same chopstick without a respective call to release. The philosopher threads are effectively deadlocked.
The Object Diagram above shows a typical deadlock state of the philosopher threads-- each outstanding call to grab is waiting for a chopstick to be released.