This project represents the solution of dining philosophers problem, but with any number of philosphers.
Each directory "philo_*" contains solution with some differences in approach:
• philo_one - using threads and mutexes
• philo_two - using threads and semaphores
• philo_three - using processes and semaphores.
cd
to philo_* directory;make
creates executable named "philo_number".
To remove all files created by program run make fclean
, or make clean
to remove all except executable.
Program arguments:
number_of_philosophers
time_to_die
time_to_eat
time_to_sleep
[number_of_times_each_philosopher_must_eat]
, time in ms.
For example ./philo_one 4 500 100 100