LAB 4: THE DINING PHILOSOPHER PROBLEM AUTHORS: Vicky Sandoval and Nyna Sayarath

This lab is a that provides a solution to the famous Dining Philosopher Problem that is starvation-free and deadlock-free. The constraints we had to cosider when solving this problem:

• Only one philosopher can hold a fork at a time

• It must be impossible for a deadlock to occur

• It must be impossible for a philosopher to starve while waiting for a fork

• It must be possible for more than one philosopher to eat at the same time

TO COMPILE AND RUN

In Eclipse, IntelliJ, or other Java compiler:

We used a jdk version 9

Run the command in stdlinux (not preferred):

$ javac DiningRoomPhilosopher.java

$ java DiningRoomPhilosopher