Skip to content

FMFigueroa/dining-philosophers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dining Philosophers

Problem

In ancient times, a wealthy philanthropist set up a university to accommodate five eminent philosophers. Each philosopher had a room in which they could carry out their professional activity of thinking. There was also a common dining room furnished with a circular table surrounded by five chairs, each one identified with the name of the philosopher who sat in it. The philosophers sat counterclockwise around the table. To the left of each philosopher lay a golden fork, and in the center, a bowl of spaghetti, which was constantly refilled. It was expected that a philosopher would spend most of their time thinking. However, when they felt hungry, they would go to the dining room, take the fork to their left and immerse it in the spaghetti. But the spaghetti was so tangled in nature that a second fork was required to bring it to the mouth. The philosopher, therefore, had to also take the fork to their right. When they finished, they had to put down both forks, get up from the chair, and resume thinking. Of course, a fork can be used by only one philosopher at a time. If another philosopher wishes to use it, they must wait until the fork is available again.

Only two philosophers can eat at any given time and consequently the output will look like this:

Gilles Deleuze esta comiendo.
Emma Goldman esta comiendo.
Emma Goldman ha finalizado de comer.
Gilles Deleuze ha finalizado de comer.
Judith Butler esta comiendo.
Karl Marx esta comiendo.
Judith Butler ha finalizado de comer.
Michel Foucault esta comiendo.
Karl Marx ha finalizado de comer.
Michel Foucault ha finalizado de comer.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages