Vol. I a living index of named laws · est. mmxxvi no ads · no tracking
The Law Tomeindex of named laws

The Dining Philosophers Problem

also known as — Dining philosophers, The five philosophers
"Five philosophers share five forks, each needing both neighbours' forks to eat, and a naive protocol leaves them all stuck."
In plain English

What does The Dining Philosophers Problem mean?

The dining philosophers problem is a classic illustration of the challenges of concurrent programming and resource allocation. Five philosophers sit around a table, with a single fork between each pair, five forks in all, and each philosopher alternates thinking and eating. To eat, a philosopher needs both the fork on their left and the one on their right, so neighbours compete for the shared forks. The problem is to devise a protocol under which every philosopher can eventually eat and none starves, while still allowing genuine concurrency. Formulated by Edsger Dijkstra, it is the canonical teaching example for deadlock, synchronisation, and the design of concurrent algorithms.

Reliability

Rated Heuristic: a dependable rule of thumb, not a proven theorem. The other 224.

Lineage
1965COINED
How it works

How does The Dining Philosophers Problem work?

The problem dramatises how independent processes competing for shared resources can fail. If every philosopher simultaneously picks up their left fork and then waits for the right one, all are stuck forever, each holding one fork and waiting on a neighbour, a deadlock caused by a circular wait. Deadlock requires four conditions to hold together, the Coffman conditions: mutual exclusion, hold-and-wait, no preemption, and circular wait, and breaking any one prevents it. Dijkstra's resource-ordering solution numbers the forks and has each philosopher pick up the lower-numbered fork first, breaking the circular wait; an arbitrator, or waiter, that grants permission is another remedy, as is limiting how many philosophers may reach for forks at once.

Figure illustrating The Dining Philosophers Problem
The Dining Philosophers Problem — bdesham, ,, User:Belbury · CC BY 3.0 · source
Where you'll see it

What are examples of The Dining Philosophers Problem?

The deadlock If all five grab their left fork at once and wait for the right, none can proceed, a circular wait in which every philosopher holds one fork and needs a neighbour's, the central illustration.
Resource ordering Dijkstra's fix numbers the forks and has each philosopher always take the lower-numbered one first, so the cycle cannot close and deadlock is impossible.
The arbitrator A waiter who grants permission to pick up forks serialises the decisions and prevents the simultaneous grab that causes deadlock.
Types & variants

What are the types of The Dining Philosophers Problem?

The Chandy-Misra solution§

A fully distributed solution using clean and dirty fork labels and message passing, requiring no central coordinator and working for arbitrary graphs of contending processes.

Limiting diners§

Allowing at most four philosophers to attempt to eat at once, which prevents the circular wait by ensuring at least one philosopher can always acquire both forks.

Why it matters

Why does The Dining Philosophers Problem matter?

The dining philosophers problem is the standard vehicle for teaching deadlock, resource allocation, and synchronisation in operating systems and concurrent programming. It makes vivid how individually reasonable rules, each philosopher grabbing a fork and waiting, can combine into a system-wide freeze, and it is the classic setting for the Coffman conditions and the strategies that defeat deadlock, from resource ordering to arbitration. Its lessons generalise far beyond the table, to any system in which concurrent processes contend for shared, limited resources, which is why it remains a fixture of computer-science education.

Working with it

How do you apply The Dining Philosophers Problem?

  • Watch the circular wait — recognise deadlock when each process holds a resource and waits on the next in a cycle, as when every philosopher grabs one fork and waits.
  • Break a Coffman condition — prevent deadlock by defeating one of the four necessary conditions, for instance imposing an order on how resources are acquired.
  • Preserve concurrency — seek a solution that avoids deadlock and starvation while still letting philosophers eat in parallel, not merely one at a time.
Where it breaks down

What are the limits of The Dining Philosophers Problem?

The dining philosophers problem is an idealised teaching model, not a real system, and its central concern is deadlock via circular wait, with starvation and livelock as secondary issues. Simplistic fixes fail: having each philosopher put a fork down and retry can cause livelock, endless activity with no progress, and the trivial rule of letting only one philosopher eat at a time avoids deadlock but destroys the concurrency the problem exists to preserve. Its value is as a minimal illustration of concurrency hazards, from which real solutions must add care about fairness and progress.

What it doesn't say

What are common misconceptions about The Dining Philosophers Problem?

The problem's central lesson is deadlock through circular wait, not starvation alone. Having philosophers drop and retry their forks is not a real solution, since it can produce livelock rather than progress. Letting only one philosopher eat at a time prevents deadlock but eliminates concurrency, which the problem explicitly seeks to keep. There are five shared forks, one between each adjacent pair, not one per hand. And the philosophers framing is Tony Hoare's retelling; Dijkstra's original 1965 version was about computers competing for tape drives.

Is it real?

Is The Dining Philosophers Problem real?

Real as a rule of thumb, not as a theorem. The Dining Philosophers Problem is rated Heuristic here: dependable enough to plan with, and with no proof behind it.

Rated from two sources. 225 of the 1,116 entries carry this rating. How the scale works.

Rarely printedin printed books: one of 196 names in its band, of 903 measured
25 of 69entries in software & systems carry the same rating

The best-known laws are the least likely to rest on measurement.

Origin

Where did The Dining Philosophers Problem come from?

Formulated by Edsger Dijkstra in 1965 as an examination exercise about computers competing for tape drives, and given its familiar dining-philosophers framing by Tony Hoare; it is the textbook illustration of the Coffman deadlock conditions.

How the name spread

When did people start saying “The Dining Philosophers Problem”?

1800coined 19652019
How often “Dining Philosophers Problem” appears in printed English, which takes hold around 1980 and peaks around 1991. The idea dates to 1965: the phrase took about 15 years to reach print in any quantity, which is the gap this chart measures. Source: Google Books Ngrams.
Known elsewhere as

What is The Dining Philosophers Problem called in other languages?

  • Arabicمسألة عشاء الفلاسفة
  • GermanPhilosophenproblem
  • Spanishproblema de la cena de los filósofos
  • Frenchdîner des philosophes
  • Italianproblema dei filosofi a cena
  • Japanese食事する哲学者の問題
  • Russianпроблема обедающих философов
  • Chinese哲学家就餐问题

8 languages, as recorded on Wikidata. These are names the idea already goes by, not translations we made. The whole index by language.

Sources

Sources & further reading

  1. 1Dining philosophers problem, Wikipedia. — the setup, the deadlock via circular wait, and the resource-ordering and arbitrator solutions.secondary
  2. 2Deadlock (computer science), Wikipedia. — the four Coffman conditions from Coffman, Elphick, and Shoshani's 1971 'System Deadlocks'.secondary

Everything above traces to two pages on en.wikipedia.org: both secondary, accounts of the original rather than the original itself, which has not been located for this entry. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.

What we checked

  • 1,116entries in the tomeListed one by one on the browse page.
  • 1,116of them citing a sourceOpen any entry: its sources sit at the foot of the page.
  • 2,489source references in allEach is named, and linked wherever the source is online.