Dining philosophers/csbook/solutions/14/A04.cs
Sample output of this program: Philosopher 0 is eating... Philosopher 1 is eating... Philosopher 2 is eating... Philosopher 3 is eating... Philosopher 1 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 2 is eating... Philosopher 3 is eating... Philosopher 1 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 2 is eating... Philosopher 3 is eating... Philosopher 1 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 1 is eating... Philosopher 2 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 1 is eating... Philosopher 2 is eating... Philosopher 3 is eating... Philosopher 4 is eating... Philosopher 1 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 3 is eating... Philosopher 2 is eating... Philosopher 1 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 1 is eating... Philosopher 2 is eating... Philosopher 3 is eating... Philosopher 4 is eating... Philosopher 0 is eating... Philosopher 1 is eating... Philosopher 4 is eating... Philosopher 2 is eating... Philosopher 3 is eating... Philosopher 1 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 1 is eating... Philosopher 2 is eating... Philosopher 0 is eating... Philosopher 4 is eating... Philosopher 1 is eating... Philosopher 2 is eating... Philosopher 3 is eating... Philosopher 4 is eating... Philosopher 0 is eating... Philosopher 1 is eating... As we can see, all philosophers get their turn and none of them has to starve. |
|||