In this project, you will learn the basics of threading a process.
You will see how to create threads and you will discover mutexes.
In computer science, the dining philosophers problem is an example problem often used
in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them.
It was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise, presented in terms of computers competing for access to tape drive peripherals.
Soon after, Tony Hoare gave the problem its present form.
Illustration of the dining philosophers problem
๐ป To use the program
you must first compile it with the makefile by using the command 'make' in the shell
number_of_philosophers: The number of philosophers and also the number
of forks.
time_to_die (in milliseconds): If a philosopher didnโt start eating time_to_die
milliseconds since the beginning of their last meal or the beginning of the simulation, they die.
time_to_eat (in milliseconds): The time it takes for a philosopher to eat.
During that time, they will need to hold two forks.
time_to_sleep (in milliseconds): The time a philosopher will spend sleeping.
number_of_times_each_philosopher_must_eat (optional argument): If all
philosophers have eaten at least number_of_times_each_philosopher_must_eat
times, the simulation stops. If not specified, the simulation stops when a
philosopher dies.