Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 726 Bytes

README.md

File metadata and controls

15 lines (13 loc) · 726 Bytes

Philosophers

Apparently serving and eating spaghetti with a single fork is very inconvenient, so the philosophers will eat with two forks.

Dining philosophers problem

The dining philosopher's problem is the classical problem of synchronization which says that Five philosophers are sitting around a circular table and their job is to think and eat alternatively. A bowl of noodles is placed at the center of the table along with five chopsticks for each of the philosophers - copy & paste from internet.

Usage

git clone <repo>
cd <repo>
cd philo
make
./philo [number_of_philosophers] [time_to_die] [time_to_eat] [time_to_sleep] [number_of_times_each_philosopher_must_eat]

(the last argument is optional)