MutualExclusion Flashcards
What is mutual exclusion in distributed systems?
A condition where only one process can access a shared resource or perform a specific function at any given time.
What is a critical section?
A section of code where a process accesses a shared resource. Only one process can be in the critical section at a time.
What are some examples of mutual exclusion in real-world systems?
1) Database updates in an enterprise system. 2) Actuator control in IoT systems. 3) Autonomous vehicles accessing a narrow bridge. 4) Robots recharging at a charging base.
What are the key requirements for a mutual exclusion algorithm?
1) Safety: No two processes can be in the critical section simultaneously. 2) Liveness: Every process should eventually enter the critical section. 3) Fairness: All processes should have a fair chance to enter the critical section. 4) Efficiency: Low complexity. 5) Robustness: Tolerates failures.
What is the centralized mutual exclusion algorithm?
A single coordinator manages access to the resource. Processes request access from the coordinator, which grants or denies access based on a queue.
What are the benefits of the centralized mutual exclusion algorithm?
Safe, live, fair, and low complexity (3 messages per request).
What are the problems with the centralized mutual exclusion algorithm?
Not robust: The coordinator is a single point of failure and a bottleneck.
What is the Token Ring algorithm?
A distributed mutual exclusion algorithm where processes are arranged in a logical ring, and a token circulates among them. The process holding the token can enter the critical section.
What are the benefits of the Token Ring algorithm?
Safe (only one process at a time has the token), live, and suitable for distributed resources.
What are the problems with the Token Ring algorithm?
Not fair, inefficient (token must always be transmitted), not robust (token loss requires regeneration), and not suitable for large-scale systems.
What is Lamport’s Mutual Exclusion Algorithm?
A fully distributed algorithm where each process maintains a request queue (FIFO) and uses logical clocks to order requests.
What are the benefits of Lamport’s Mutual Exclusion Algorithm?
Safe, live, and fair.
What are the problems with Lamport’s Mutual Exclusion Algorithm?
High complexity (3*(N-1) messages) and not robust (if a process dies, the algorithm is blocked).
What is the Ricart & Agrawala Algorithm?
A simplification of Lamport’s algorithm that combines REPLY and RELEASE messages to reduce message traffic.
What are the benefits of the Ricart & Agrawala Algorithm?
Safe, live, fair, and more efficient than Lamport’s (2*(N-1) messages).