Sleep, eat and think!
Nota: 125/100 ✔️
Philosophers is a project that aims to solve the dining philosophers problem using threads and mutexes. The dining philosophers problem is a classic synchronization problem that models a dining room with five philosophers sitting around a circular table doing one of three things: eating, thinking, or sleeping. The philosophers must never be starving, and they must never be deadlocked.
- Clone the repository
- Run
make
to compile the project - Run
./philo
with the following arguments:- Number of philosophers
- Time to die
- Time to eat
- Time to sleep
- Number of times each philosopher must eat (optional)