This implies that no neighboring philosphers can eat at the same time and that at most two philosphers can eat at a time. A solution to the problem has to guarantee mutually exclusive access to the resources, absence of deadlock and absence of starvation. A deadlock can occur when all philosophers decide to lift up their right fork, then trying to lift up the left fork but block since the left fork is already taken. If nobody puts down a fork, a circular dependency of the waiting condition on the resources exists, i.e. a deadlock. The philosophers are implemented as Java threads, each of them thinking for a random time and then eating for a random time.
Starvation is handled by the queuing policy on the monitor of the room.
The animation is realized by an extension to the Java Animator by Herb Jellinek. Here is the solution just described. There are many more solutions to the problem of the dining philosophers.