Professional Documents
Culture Documents
Synchronization in Distributed Systems: CS-4513 D-Term 2007
Synchronization in Distributed Systems: CS-4513 D-Term 2007
Distributed Systems
CS-4513
D-Term 2007
(Slides include materials from Operating System Concepts, 7th ed., by Silbershatz, Galvin, & Gagne,
Modern Operating Systems, 2nd ed., by Tanenbaum, and Distributed Systems: Principles & Paradigms, 2nd
ed. By Tanenbaum and Van Steen)
• Scenario
• make on machine A to build foo.o
• Test on machine B; find and fix a bug in foo.c
• Re-run make on machine B
• Nothing happens!
• Why?
A T4
T1
A T4
T1
• Berkeley Algorithm
• Time Daemon polls other systems
• Computes average time
• Tells other machines how to adjust their clocks
• Definition: a b means
• a occurs before b
• I.e., all processes agree that a happens, then later b
happens
• E.g., send(message) receive(message)
CS-4513, D-Term 2007 Synchronization 14
Logical Clocks (continued)
• Two approaches
• Token
• Permission
• Advantages
– Mutual exclusion guaranteed by coordinator
– “Fair” sharing possible without starvation
– Simple to implement
• Disadvantages
– Single point of failure (coordinator crashes)
– Performance bottleneck
–…
• Advantage
– No central bottleneck
– Fewer messages than Decentralized
• Disadvantage
– n points of failure
– i.e., failure of one node to respond locks up
system
• Advantages
• Fairness, no starvation
• Recovery from crashes if token is not lost
• Disadvantage
• Crash of process holding token
• Difficult to detect; difficult to regenerate exactly one token
CS-4513, D-Term 2007 Synchronization 27
Next Time