Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M3836

Dining Philosophers Problem

Dining Philosophers Problem
CultureHigh supportPhilosophy
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

The Dining Philosophers Problem is a classic problem in computer science that demonstrates issues arising in multi-threaded synchronization in concurrent computing. In 1971, Dutch computer scientist Edsger Dijkstra posed a synchronization problem involving five computers attempting to access five shared tape drives. Later, Tony Hoare reformulated it as the Dining Philosophers Problem. This problem can be used to explain deadlock and resource exhaustion.

Definition

Five philosophers sit around a table with one chopstick between each pair (five total). Each philosopher either thinks or eats. To eat, they need both left and right chopsticks. If everyone picks up the left chopstick and waits for the right, all will starve (deadlock). Scaffold use: resource competition deadlock. Metaphor for resource allocation in organizations. If everyone holds a portion of resources without releasing, waiting for others to release, the whole organization becomes paralyzed (deadlock). Mechanisms like 'resource hierarchy' or 'waiter (arbiter)' must be introduced.

How to use

Resource competition deadlock. Metaphor for resource allocation in organizations. If everyone holds a portion of resources without releasing, waiting for others to release, the whole organization becomes paralyzed (deadlock). Mechanisms like 'resource hierarchy' or 'waiter (arbiter)' must be introduced.

Mechanism

Five philosophers sit around a table, alternating between thinking and eating. Each needs to pick up both left and right chopsticks simultaneously. If all pick up the left chopstick at the same time, deadlock occurs; if they randomly put down, starvation may occur. It abstracts the mutual exclusion and synchronization issues of multiple processes competing for limited shared resources.

Practice

In progress 0/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Database transaction lock contention; multi-threaded concurrent access to shared buffers.

Common pitfalls

  • Thinking that locking always solves the problem (improper locking can cause deadlock); ignoring fairness and livelock.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E5%93%B2%E5%AD%A6%E5%AE%B6%E5%B0%B1%E9%A4%90%E9%97%AE%E9%A2%98ZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS