Please enable JavaScript.
Coggle requires JavaScript to display documents.
Week 7 Distributed (Synchronisation (Clock Synchronization (Cristian's…
Week 7 Distributed
Synchronisation
-
-
-
-
Clock Synchronization
-
-
Cristian's Algorithm
-
-
Requestor sets clock to
recieved_time + (T1 - T0 - I)/2
- T1 is time requestor recieved
- T0 is time requestor sent
- I is interrupt handling time
-
-
-
-
Berkeley Algorithm
-
Steps
- Master chosen with ring based election (Chang & Roberts)
- Master polls slave who reply with their time
- Master measures RTT and estimates slave time & its own
- Average times ignoring outliers
- Sends offsets to each slave to adjust their time to the average. Avoids uncertainty due to RTT
-
-
-
Lamport's Sync Algorithm
-
-
-
-
-
Clock forward, never backward
Mutual exclusion
Coordinator Process
-
Steps
- Process A sends request to access a resource
- Coordinator checks if someone is already using that resource
- If someone is not, then process A is let through. Otherwise they are queued until that process notifies the coordinator they are done
Advantages
- FCFS therefore it's fair
- Simple & easy to implement
- Only 3 msgs: request, grant and release
Disadvantage
- Central point of failure
- Cannot distinguish between dead coordinator or permission denied
- Performance bottleneck if only one coordinator
-
-
Comparison of algorithms
-
Reliability problems
Centralized: Coordinator crash
Distributed: Any process crashes
Ring: Lost token, process crash
Deadlocks
Communication deadlock
Happens when A is trying to send a message to B which is trying to send to C which is trying to send to A.
-
-
-