Skip to content

A C programming answer to Dijkstra's dining philosophers problem using threads and mutexes.

Notifications You must be signed in to change notification settings

aegraetz/Philosophers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Philosophers 🍝 😴 🧘‍♀️

A C programming answer to Dijkstra's dining philosophers problem using threads and mutexes.

Problem 🥢

A group of philosophers sit around a table with a bowl of spaghetti in the middle. Each must eat to survive but each only brought one fork (originally a chopstick) and needs two forks to eat the spaghetti. Therefore, they must take turns eating, sleeping and thinking in order to stay fed and avoid starving to death. This is achieved through the use of threads and mutexes.

User inputs the following:

  • number_of_philosophersc
  • time_to_die;
  • time_to_eat;
  • time_to_sleep;
    and, optionally,
  • number_of_times_each_philosopher_must_eat

Results 🖋️

Success with 100%

About

A C programming answer to Dijkstra's dining philosophers problem using threads and mutexes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published