Five philosophers are sitting around a circular table for a meal of spaghetti. For any philosopher to eat spaghetti, they must have two forks: one in the left hand and one in the right hand. However, they have just five forks total on the table.
To coordinate their meal, the philosophers agree to strictly follow these steps:
- Think until the left fork is available, and then pick it up.
- Think until the right fork is available, and then pick it up.
- Eat for 30 seconds.
- Put the right fork down.
- Put the left fork down.
- Repeat these steps.
Can we guarantee that at least one philosopher is eating every 30 seconds?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
All philosophers instantly pick up the left fork, and then are all waiting for the right fork to come available, meaning that no-one ever eats spaghetti