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-- Before Execution

1. Application UI

All five philosophers before the threads begin to run.

UI-- Concurrency

1. Sequence Diagram (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.

2. Object Diagram (concurrency)

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

1. Application UI (deadlock)

All five philosophers with one hand raised waiting for a chopstick grabbed by another philosopher.

2. Sequence Diagram (deadlock)

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.

3. Object Diagram (deadlock)

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.