The mandatory part of this project asks us to solve the dining philosophers problem and implement a mutithreading solution using mutexes.
You can see the subject HERE.
To visualize the output copy the actions made by the philosophers HERE.
1- Clone this repository
git clone https://github.com/MGuardia10/42cursus_philosophers.git
2- Navigate to the new directory and run make
cd 42cursus_philosophers
make
3- make clean
to remove the object files and work on a cleaner directory
make clean
4- Start the simulation using the correct arguments:
./philo <number_philos> <time_to_die> <time_to_eat> <time_to_sleep> [number_of_meals]
The philo program comes with a Makefile that includes the following rules:
all
: compiles the program.re
: recompiles the program.clean
: removes obj directory with objects files.fclean
: removes obj directory with objects files and philo binary.
At 42School, almost every project must be written in accordance to the Norm, the school's coding standard. As a result, the implementation of certain parts may appear strange and for sure had room for improvement.