Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Philosophers (at least one philosopher) are sitting around a round table with a large plate of spaghetti in the center.
• Philosophers are either eating, thinking, or sleeping.
When they are eating, they cannot think or sleep.
When they are sleeping, they cannot eat or think.
Finally, when they are thinking, they cannot eat or sleep.
• There are also forks on the table. There are as many forks as there are philosophers.
• Since serving and eating spaghetti with a single fork is not easy, a philosopher takes the fork on his left and the one on his right, one fork in each hand, in order to eat.
• When a philosopher finishes eating, he puts the forks on the table and starts sleeping. Once awake, he starts thinking again. The simulation ends if a philosopher dies of hunger.
• Each philosopher needs to eat and must not die of hunger.
• Philosophers do not communicate with each other.
• Philosophers cannot know if one of them is about to die.
• Needless to say, the philosophers must not die!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages