Dining philosophers problem

In the problem, each philosopher has a bowl of spaghetti and can reach the two forks on either side of them.

In computer science, the dining philosophers problem is an example problem often used in concurrent algorithm design to illustrate synchronization issues and techniques for resolving them.

It was originally formulated in 1965 by Edsger Dijkstra as a student exam exercise, presented in terms of computers competing for access to tape drive peripherals and then formulated in terms of diners, dubbed the "dining quintet". Soon after, Tony Hoare gave the problem its present name.