Philosopher dinner - Solution 2

State Diagram

This solution is equivalent to the one proposed by Dijkstra.

Every philosopher, when wants to eat, gets the two forks at the same time.

If they are not available, the philosopher waits in the hungry/waiting state.

Starvation is not avoided.

Last updated