Verteilte Systeme (Distributed Systems)
Karl M. Göschka Karl.Goeschka@tuwien.ac.at
http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/
Verteilte Systeme (Distributed Systems) Karl M. Gschka - - PowerPoint PPT Presentation
Verteilte Systeme (Distributed Systems) Karl M. Gschka Karl.Goeschka@tuwien.ac.at http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/ Lecture 6: Clocks and Agreement Synchronization of physical clocks Logical clocks
http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/
3
4
5
6
7
8
9
T2‘=T2-θ T3‘=T3-θ
10
11
12
14
a) The time daemon asks all the other machines for their clock values b) The machines answer c) The time daemon tells everyone how to adjust their clock
15
16
19
20
Fixed! This situation must be prevented
21
22
p1 p2 p3 a b c d e f m1 m2 Physical time
23
24
25
26
31
32
Concurrent message transmission using logical clocks.
33
a b c d e f m1 m2 (2,0,0) (1,0,0) (2,1,0) (2,2,0) (2,2,2) (0,0,1) p1 p2 p3 Physical time
34
35
39
42
43
45
46
48
49
51
52
53
56
58
24 15 9 4 3 28 17 24 1
Note: The election was started by process 17. The highest process identifier encountered so far is 24. Participant processes are shown darkened
60
61
62
63
64
66
p2 p1 message garbage object
reference
p2 p1 wait-for wait-for
p2 p1 activate passive passive
state of communication channel! state of communication channel!
67
68
69
71
72
p1 p2 (empty) <$1000, 0> <$50, 2000> (empty) c2 c1
p1 p2 (Order 10, $100), M <$900, 0> <$50, 2000> (empty) c2 c1 p1 p2 (Order 10, $100), M <$900, 0> <$50, 1995> (five widgets) c2 c1 p1 p2 (Order 10, $100) <$900, 5> <$50, 1995> (empty) c2 c1 (M = marker message)
p1 p2 c2 c1 account widgets $1000 (none) account widgets $50 2000 Final state: P1 <$1000,0>; P2<$50,1995>; c1<five widgets>; c2<> Process P2 has already received an order for five widgets before S0
M
75
Sinit Sfinal Ssnap actual execution e
0,e1,...
recording recording begins ends pre-snap: e
post-snap: e
77