output.webm
Philosophers (Dining philosophers problem) is a project where the goal is to let n amount of philosophers eat indefinitely without dying. Each philosopher must take forks to be able to eat, then sleep, and then think whenever they're not eating nor sleeping. By achieving the goal, we adquire knowledge about concurrency problems such as deadlocks and data races and how to deal with them.
Clone the repository and build the program
git clone https://github.com/ribana-b/philosophers
cd philosophers/philo
make -j4
Run the program
./philo 10 800 200 200 2
Note
Parameter | Value range |
---|---|
number of philosophers | 1-200 |
time to die | 60-999999 |
time to eat | 60-999999 |
time to sleep | 60-999999 |
number of meals per philosopher (optional) | 0-999999 |
If you are interested in checking my progress in 42 Common Core, I suggest you to take a look at My Common Core Projects