Skip to content

TheFr34k42/philo

Repository files navigation

Dining philosophers problem alias philosophers

The dining philosophers problem is invented by E. W. Dijkstra. Imagine that five philosophers who spend their lives just thinking and eating. In the middle of the dining room is a circular table with five chairs. The table has a big plate of spaghetti. However, there are only five forks available, as shown in the following figure. Each philosopher thinks. When he gets hungry, he sits down and picks up the two forks that are closest to him. If a philosopher can pick up both forks, he eats for a while. After a philosopher finishes eating, he puts down the chopsticks and starts to sleep or think.

drawing

Diagram

I tried to make diagram to explain how to solve the problem with threads .

alt text

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published