Skip to content

Solving dining philosophers problem with threads and mutex

Notifications You must be signed in to change notification settings

gulsro/philosophers_v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

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. Philosophers project requires to solve The Dining Philosopher Problem problem using threads and mutex. The solution was implemented using a monitor function (being called in main hread), which checks if any philosopher has died and warns others to stop (locking mutex).

Access the folder

cd philo

Compile

make

Run the program with <number_of_philosophers> <time_to_die> <time_to_eat> <time_to_sleep> [number_of_times_each_philosopher_must_eat (optional argument)]

./philo 5 800 200 200 7

Remove objects

make clean

Remove objects and executable

make fclean

About

Solving dining philosophers problem with threads and mutex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published