- Model question
Ways to achieve distributed mutex
Short answer
Distributed mutual exclusion ensures only one process accesses a critical section at a time via message passing. It can be achieved by permission-based algorithms (centralized, Lamport, Ricart-Agrawala, Maekawa quorum) and token-based algorithms (token ring, Suzuki-Kasami, Raymond's tree).
Define distributed mutual exclusion. In how many ways can the mutual exclusion be achieved in distributed system? (see all mutual exclusion algorithms)
Distributed mutual exclusion guarantees that only one process at a time accesses a shared resource or critical section (CS) in a distributed system where processes only communicate by messages and share neither memory nor a clock. The requirements are safety (one process in CS), liveness (no deadlock) and fairness (no starvation).
Mutual exclusion can be achieved in the following ways.
A. Non-token-based (permission-based) algorithms
A process asks others for permission before entering the CS.
- Centralized algorithm: one coordinator grants permission. 3 messages per entry; coordinator is a bottleneck and single point of failure.
- Lamport's algorithm: timestamped requests kept in queues at all nodes; 3(N−1) messages.
- Ricart-Agrawala algorithm: request to all, deferred replies; 2(N−1) messages.
- Maekawa's algorithm (quorum/voting): permission from a subset of about √N processes; about 3√N messages.
B. Token-based algorithms
A unique token represents the right to enter the CS; only its holder may enter.
- Token ring algorithm: the token circulates in a logical ring; 1 to N−1 messages per entry, but circulates continually.
- Suzuki-Kasami broadcast algorithm: a requester broadcasts a request for the token; N messages per entry.
- Raymond's tree-based algorithm: processes form a tree; the request moves toward the token holder; O(log N) messages.
C. Others
Mutual exclusion can also be achieved by a hierarchical or hybrid approach and by fault-tolerant versions with election of a new coordinator or token regeneration.
| Class | Representative | Messages per entry |
|---|---|---|
| Centralized | Coordinator | 3 |
| Non-token | Lamport / Ricart-Agrawala | 3(N−1) / 2(N−1) |
| Quorum | Maekawa | ~3√N |
| Token | Ring / Suzuki-Kasami | 1..N−1 / N |
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Token ring mutual exclusion · Distributed System, chapter 6 · asked 3×
- Ricart-Agrawala mutual exclusion · Distributed System, chapter 6 · asked 2×
- Lamport algorithm for mutual exclusion · Distributed System, chapter 6
- Mutex requirements; token vs non-token · Distributed System, chapter 6
- Autonomous vs distributed system · Distributed System, chapter 1
- Models of distributed system · Distributed System, chapter 1
- Critical section; mutual exclusion · Operating System, chapter 3
- Race condition; mutual exclusion requirements · Operating System, chapter 3
- Semaphore for mutual exclusion · Operating System, chapter 3
- Mutual exclusion via sleep and wake · Embedded System, chapter 6