LU5 Coordination and Agreement Flashcards
What is the critical section (CS) in distributed systems?
A segment of code where a process accesses shared resources, requiring mutual exclusion.
Why is mutual exclusion important in distributed systems?
to prevent race condition, and protect data integrity and accuracy.
What is the main challenge in achieving mutual exclusion in distributed systems?
The lack of shared variables or facilities provided by a single local kernel.
solution: message passing.
What is a semaphore?
A mechanism that controls access to the critical section by putting processes in a FIFO queue.
How does a semaphore prevent busy waiting?
By queuing processes and allowing them to enter the critical section one at a time.
Which Java class provides semaphore functionality?
java.util.concurrent.Semaphore.
What are the three essential requirements for distributed mutual exclusion?
ME1: Safety, ME2: Liveness, ME3: Ordering.
What does ME1 (Safety) ensure?
At most one process may execute in the critical section at a time.
What does ME2 (Liveness) ensure?
Requests to enter and exit the critical section eventually succeed.
What does ME3 (Ordering) ensure?
Requests are granted in the order they were made if one happened before another.
What is starvation in distributed mutual exclusion?
when a process is indefinitely blocked from accessing a critical section due to unfair scheduling.
Why can’t request time be used for ordering in distributed systems?
Due to the lack of a global clock.
How is ordering typically managed in distributed systems?
Using the happen-before relationship.
(causal relationship)
What factors are considered in performance evaluation of mutual exclusion algorithms?
- Network Bandwidth consumption
- client delay
- system throughput.
What is a permission-based algorithm for mutual exclusion?
An algorithm where processes request permission to enter the critical section.
What is a token-based algorithm for mutual exclusion?
An algorithm where a unique token circulates among processes, granting access to the critical section.
What is the Central Server Algorithm?
A server will grant permission to the client request to enter the critical section by issuing a token
How does the Central Server Algorithm handle requests?
The server queues requests if the token is held by another process.
What is the main limitation of the Central Server Algorithm?
It does not satisfy the ordering requirement (ME3).
What is the Ring-based Algorithm?
Processes are arranged in a logical ring and pass a token clockwise to manage mutual exclusion.
How does the Ring-based Algorithm ensure mutual exclusion?
Only the process holding the token can enter the critical section.
What is the primary drawback of the Ring-based Algorithm?
The token passing mechanism will continue consumes bandwidth even when no process request access to the CS.
What is a multicast-based mutual exclusion algorithm?
Processes multicast requests (the timestamp) and enter the critical section when ALL others have replied. (confirming no earlier requests)
What role do logical clocks play in multicast-based algorithms?
They help order requests based on timestamps.
(from lower–> higher timestamp)