Skip to content

kamilprzybyl/Philosophers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 

Repository files navigation

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)