Skip to content

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