Download - by J. Burns and J. Pachl
by J. Burns and J. by J. Burns and J. PachlPachl
Prepared by:
Irina Shapira
Julia MosinModified by Mordo Shalom
Uniform Self-Uniform Self-StabilizationStabilization
Self-Stabilizing System: Self-Stabilizing System: S = (G, R, S = (G, R, , , ))• G = (V,E) G = (V,E)
• = = 0 0 x 1 1 x . . . x n-1 n-1 - - set of configurationsset of configurations
wherewhere i i is a finite set of states of processor Pis a finite set of states of processor Pi i
• R - R - orientation of Gorientation of G
specifies a total ordering on the neighbors for each v specifies a total ordering on the neighbors for each v in Vin V
• = = 0 0 , 1 1 , . . . , n-1 n-1 - - sequence of transition sequence of transition
relationsrelations
wherewhere i i is a transition relation of processor Pis a transition relation of processor Pi i
from from i i x v1 v1 x . . . x vk vk to to i i ( R(i) = (v( R(i) = (v11, . . ., , . . .,
vvkk))))
For configuration For configuration ((ss00, s, s11, … , s, … , sn-1n-1) ) wherewhere
• ssjj is a state of P is a state of Pj j (for all j). (for all j).
Self-Stabilizing System: Self-Stabilizing System: S = (G, R, S = (G, R, , , ))
• x - possible next state of Px - possible next state of Pii , ,
i.e. if i.e. if R(vR(vii) = (v) = (v11, . . ., v, . . ., vkk ) then ( ) then (ssii,s,sv1v1, …, s, …, svk vk , x, x) )
iiwe define we define i i (())
as a set of as a set of allall configurations configurations ’’
such that such that ’’ss00,s,s11, …, s, …, si-1i-1, x, s, x, si+1i+1, …, s, …, sn-1n-1) )
(for all possible values of x)(for all possible values of x)
• PPi i is enabled (privileged) at is enabled (privileged) at if if i i (() is not ) is not
emptyemptyi
• ’’is a step of Pis a step of Pii if if ’’ i i (() )
• ’’is a step of Pis a step of Pii for some i for some i
• is a computation of the system is a computation of the system
where where
j-1j-1jj for all j for all j
Only one processor takes a step at a time -Only one processor takes a step at a time -
central daemoncentral daemon
Self-Stabilizing System: Self-Stabilizing System: S = (G, R, S = (G, R, , , ))
P0
is a system S = (G, R, is a system S = (G, R, , , ) where) where
An n-processor uniform ringAn n-processor uniform ring
• G is a cycleG is a cycle
• processors are denoted by 0,1, …, n-1 in processors are denoted by 0,1, …, n-1 in order order around the cycle around the cycle• R(i) = ( (i-1) mod n, (i+1) mod n )R(i) = ( (i-1) mod n, (i+1) mod n )
• 0 0 = 1 1 = . . . = n-1 n-1
• 0 0 = 1 1 = . . . = n-1n-1
P1
P2
P3P4
P5
Definition 1:Definition 1:A system S = (G, R, A system S = (G, R, , , ) is ) is self-stabilizingself-stabilizing iff iff there is a set there is a set , , called the called the legitimate configurationslegitimate configurations of S, such that: of S, such that:
For every For every there is a there is a ‘‘ such that such that ’’ (1) No Deadlock (1) No Deadlock
For every For every , every , every ’’ such that such that ’’ is in is in (2) Closure (2) Closure
Every infinite computation of S contains a configuration Every infinite computation of S contains a configuration
in in
(3) No Livelock (3) No Livelock
For every For every , exactly one processor is enabled, exactly one processor is enabled (4) Mutual Exclusion (4) Mutual Exclusion
For every processor For every processor PPii, every infinite computation , every infinite computation
consisting of configurations in consisting of configurations in contains an infinite contains an infinite
number of steps by number of steps by PPii
(5) Fairness (5) Fairness
Theorem 1:Theorem 1:There is no uniform n-processor self-stabilizing There is no uniform n-processor self-stabilizing ring ring if n is composite. if n is composite.
Proof:Proof:
P0
P1
P2
P3
P4
P5
• [i] = {P[i] = {Pjj | j = i mod | j = i mod p}p}• Sym(Sym() ) all the P all the Pjj in [i] are in the same state in in [i] are in the same state in
...2
...1
...0
• if Sym(if Sym(00) holds, we can construct an infinite ) holds, we can construct an infinite computation computation for which Sym(for which Sym(ii) holds for every i) holds for every i
00::
s0
s0
s0
s0s0
s0
11::
s1
s1s1
s2
s2
s2
22::
If the size of the ring is If the size of the ring is prime:prime:
• no distinguished processorno distinguished processor
• ( n( n2 2 ) states) states
• deterministic algorithmdeterministic algorithm
• central demoncentral demon
The Protocol:The Protocol:
• deterministicdeterministic
• unidirectional unidirectional (the value of (the value of ii((ssii, , ssi-1i-1, , ssi+1i+1) depends only on ) depends only on ssii and and ssi-1i-1))
s si-1i-1 ssii -> x means that x -> x means that x ii(s(sii,s,si-1i-1,s,si+1i+1) for any s) for any si+1i+1
A First AttemptA First Attempt
• 0 0 = 1 1 = . . . = n-1 n-1 = { 0, 1, …, n-2 }
• arithmetic modulo n-1arithmetic modulo n-1
The rule: if The rule: if ssii ssi-i-11+1 then +1 then ssi-i-11 ssii ssi-i-
11+1+1
P0
P2P3
P4 P1
00
00
1122
33
0 0 00 1 2 3 1 2 3
11P1
P2
0 1 0 1 11 2 3 2 3
PP0 0 PP1 1 PP2 2 PP3 3 PP44
0 1 2 0 1 2 22 3 3
P2
22P3
0 1 2 3 0 1 2 3 33
33P3
P4
00 1 2 3 0 1 2 3 0
P400
P0
...
0 0 00 1 2 3 1 2 3
0 0 00 1 2 3 1 2 3
P0
P1
22
33
11
00
The cycle of the intended The cycle of the intended legitimate configurations legitimate configurations
The rule: if sThe rule: if sii s si-i-11+1 then s+1 then si-i-11 ssii s si-i-
11+1+1
P2P3
P4
00
11
2200
11
00 1 2 1 2 00 1 1
PP0 0 PP1 1 PP2 2 PP3 3 PP44
...
00 1 2 1 2 00 1 1
The cycle which does not The cycle which does not intersect the cycle of the intersect the cycle of the legitimate configurations legitimate configurations
P1
P0
P3
00 1 2 3 1 2 3 11
P3
P0
P4
33
22 11 2 3 2 3 11 P0
22
P1P4
22 11 2 3 0 2 3 0 00 P4
P0
P1 22 3 3 22 3 0 3 0
P0
P1 33
P2
11 33 22 3 3 00
P0
11
P1
P2
11 33 0 0 33 0 0
P1
P2
00P3
1 21 2 00 33 0 0
P1 22
P2P3
1 21 2 00 1 1 00 P2P3
11
P4
00 1 2 1 2 00 1 1 00
P0
11
22P2P3
00
P411
livelocklivelock
The rule: if sThe rule: if sii s si-i-11+1 then s+1 then si-i-11 ssii s si-i-
11+1+1
The Protocol:The Protocol:• n n 3 3
• states are states are label.tag (Llabel.tag (Lii.T.Tii))
• labels range over { 0, 1, …, n-2 }labels range over { 0, 1, …, n-2 }
• tags range over { 0 } U { 2, 3, …, n-2 }tags range over { 0 } U { 2, 3, …, n-2 }
Rule A: Rule A: if if LLi i LLi-i-11+1 and +1 and ( (LLii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii--LLi-i-11 or T or Ti-i-11<<TTii) ) then then LLi-i-11.T.Ti-i-11 LLii.T.Tii ( (LLi-i-11+1).(+1).(LLii--LLi-i-11))
Rule B: Rule B: if if LLi i = = LLi-i-11+1 +1 and and LLi i 0 and T 0 and Ti-i-11 T Tii then then LLi-i-11.T.Ti-i-1 1 LLii.T.Tii LLii.T.Ti-i-11
The Proof of Self-The Proof of Self-Stabilization:Stabilization:LetLet be the set of all cyclic permutations of be the set of all cyclic permutations of configurations of the formconfigurations of the form
0.0 1.0 … a-1.0 a.0 0.0 1.0 … a-1.0 a.0 a.0a.0 a+1.0 … n-2.0 a+1.0 … n-2.0
for a=0, 1, …, n-2for a=0, 1, …, n-2
Theorem 3:Theorem 3:If n is prime, then the ring is self-If n is prime, then the ring is self-stabilizingstabilizing(and (and is a set of legitimate is a set of legitimate configurations) configurations)
S = (G, R, S = (G, R, , , ))
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Definition 2:Definition 2:Let Let be a configurationbe a configuration
• if Lif Li+i+11 LLii+1 (mod n-1), then P+1 (mod n-1), then Pi i and Pand Pi+i+1 1 formform a a gapgap of of • the the gap sizegap size (of (of PPi i and and ) ) g(i,g(i,LLi+i+11- - LLi i (mod (mod n-1)n-1)• a a segmentsegment of of is a maximal cyclically is a maximal cyclically contiguous contiguous sequence s=(P sequence s=(Pii, P, Pi+i+11, …, P, …, Pj-j-11, P, Pj j ) ) which contains which contains no gapsno gaps• the the gap size of sgap size of s g(s g(s,, is the gap size of its is the gap size of its rightright end (g(j, end (g(j,))))
• PPi i is is the the left endleft end of s, of s, PPjj is the is the right endright end of s of s
• a segment is a segment is zero basedzero based if its left end is 0 ( if its left end is 0 (LLii = 0)= 0)ExampleExample::
(P6 P0 P1 P2) zero based segmentgap of size 2 gap of size 5
PP00 P P11 P P22 P P3 3 PP44 P P55 P P66
1.3 2.3 3.1 5.2 0.2 1.1 0.41.3 2.3 3.1 5.2 0.2 1.1 0.4
PP00 P P11 P P22 P P3 3 PP44 P P55 P P66
1.3 2.3 3.1 1.3 2.3 3.1 5.2 0.2 1.1 5.2 0.2 1.1 0.4 0.4
1.01.0
2.02.0
3.33.32.32.3
3.03.0
1.01.0 2.0 2.0 3.33.3 2.32.3 3.03.0
PP0 0 PP1 1 PP2 2 PP3 3 PP44
P1
P0
P3P2
0.20.2 2.02.0 3.33.3 2.32.3 3.03.0
P4
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
0.20.2
P0
P1
0.20.2 1.21.2 3.33.3 2.32.3 3.03.0
1.21.2P1P4
0.20.2 1.21.2 3.33.3 2.32.3 3.3 3.3
3.33.3 P4
P3
0.20.2 1.21.2 3.33.3 0.30.3 3.33.3
0.30.3P3
P4 0.20.2 1.21.2 3.33.3 0.30.3 1.31.3 1.31.3 P4
P2
0.20.2 1.21.2 2.22.2 0.30.3 1.31.3
2.22.2P2P3
0.20.2 1.21.2 2.22.2 3.2 3.2 1.31.3
3.23.2P3
P4
0.20.2 1.21.2 2.22.2 3.2 0.23.2 0.2
0.20.2 P4
P0
1.01.0 1.21.2 2.22.2 3.2 0.23.2 0.2
1.01.0
P1
1.01.0 2.02.0 2.22.2 3.2 0.23.2 0.2
P1 2.02.0
P2
1.01.0 2.02.0 3.03.0 3.23.2 0.2 0.2
P2
3.03.0P3
1.01.0 2.02.0 3.03.0 0.0 0.0 0.20.2
0.00.0P3
P4
1.01.0 2.02.0 3.03.0 0.0 1.00.0 1.0
1.01.0 P4
P0P0
Definition 1:Definition 1:A system S = (G, R, A system S = (G, R, , , ) is ) is self-stabilizingself-stabilizing iff iff there is a set there is a set , , called the called the legitimate configurationslegitimate configurations of S, such that: of S, such that:
(1) No Deadlock (1) No Deadlock
(2) Closure (2) Closure
(3) No Livelock (3) No Livelock
(4) Mutual Exclusion (4) Mutual Exclusion
(5) Fairness (5) Fairness
Lemma 1:Lemma 1:Conditions 2 (Closure), 4 (Mutual Exclusion), Conditions 2 (Closure), 4 (Mutual Exclusion), and 5 (Fairness) of Definition 1 hold for and 5 (Fairness) of Definition 1 hold for and and S.S.Proof:Proof:• all configurations in all configurations in are cyclic permutations of the formare cyclic permutations of the form
= 0.0 1.0 … a-1.0 a.0 = 0.0 1.0 … a-1.0 a.0 a.0a.0 a+1.0 … n-2.0 a+1.0 … n-2.0• TTii = T = Tjj for all i and j, hence rule B does not apply for all i and j, hence rule B does not apply
• rule A applies to exactly one processor - rule A applies to exactly one processor - Mutual ExclusionMutual Exclusion
• ’’by rule A by rule A ’’ = 0.0 1.0 … a-1.0 a.0 a+1.0 = 0.0 1.0 … a-1.0 a.0 a+1.0 a+1.0a+1.0 … n-2.0 … n-2.0
’’- - ClosureClosure
• if Pif Pii is enabled in is enabled in , then P, then Pi+i+1(mod n)1(mod n) will be enabled in will be enabled in ’’- - FairnessFairness
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Lemma 2:Lemma 2:
Proof:Proof:
If n is prime, then some processor is enabled for every If n is prime, then some processor is enabled for every configuration in configuration in , and therefore Condition 1 (No , and therefore Condition 1 (No Deadlock) holdsDeadlock) holds
• if rule A doesn’t apply, then all the segments if rule A doesn’t apply, then all the segments are zero-are zero-basedbased
• Case 1: one zero-based segment of length nCase 1: one zero-based segment of length n
if Tif Ti-1 i-1 = 0 rule A applies = 0 rule A applies
else Telse Ti-1 i-1 0 and so T 0 and so Ti-1 i-1 LLi i - L- Li-1 i-1 and again rule A appliesand again rule A applies
… … LLi-1i-1.T.Ti-i-
11 0.T0.Ti . i . … …
… 0.Ti-1
0.Ti ...
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
• Case 2: there is more than one segment Case 2: there is more than one segment
0.t0.t1 1 1.t 1.t11 … … mm11.t.t11
0.t0.t22 1.t 1.t22 … … mm22.t.t2 2
0.t0.tll 1.t 1.tll … m … mll.t.tll
...
all the gaps and all the segments have the same sizeall the gaps and all the segments have the same size
Since n is prime, all the segment lengths must Since n is prime, all the segment lengths must be 1be 1
0.00.0 ...0.00.0 0.00.0 0.00.0
and rule A applies for every gapand rule A applies for every gap
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
rule B is not applicable - all tags within each segment are rule B is not applicable - all tags within each segment are equalequal
rule A doesn’t apply - Trule A doesn’t apply - Ti-1i-1= L= Lii- L- Li-1i-1 for each gap for each gap ttjj = 0 - m = 0 - mjj
rule A doesn’t apply - trule A doesn’t apply - tj j t tj+1j+1 for each gap for each gap
Lemma 3:Lemma 3:
Proof:Proof:
In every infinite computation of S, every processor takes a In every infinite computation of S, every processor takes a step by rule A infinitely many times step by rule A infinitely many times
• suppose that there is no such Psuppose that there is no such Pii
• if someif some PPii takes an infinite number of steps by rule A, so takes an infinite number of steps by rule A, so do alldo all
• all labels are fixed and so are all segmentsall labels are fixed and so are all segments
• the left end of the segment cannot take a step by the left end of the segment cannot take a step by rule Brule B• PPii which is not the left end can take at most one step more which is not the left end can take at most one step more than Pthan Pi-1i-1
... P... Pi-i-
11
PPi i ……
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Lemma 4:Lemma 4:
Proof:Proof:
For any computation of S, the number of segments is For any computation of S, the number of segments is nonincreasing. nonincreasing.
• rule B does not change the number of segments rule B does not change the number of segments
• rule A cannot increase the number of segmentsrule A cannot increase the number of segments
Pi … Pi-1 Pi
… Pi-1 Pi Pi+1 … Pi+1 …
Pi+1 … … Pi-1 Pi+1 …
… Pi-1 Pi
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Definition:Definition:
A computation in which the number of A computation in which the number of segments is constant is called segments is constant is called quietquiet..
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Definition :Definition :Let C =Let C =00 1 1 … be a quiet computation… be a quiet computation
• a dynamic gapa dynamic gap is a function z from indices of is a function z from indices of computation computation into indices of processors, satisfying the following: into indices of processors, satisfying the following: (1) processor z(0) is the right end of the segment in (1) processor z(0) is the right end of the segment in 00
(2) if (2) if j-1j-1-> -> jj is a step of P is a step of Pii by rule A and z(j-1) = i-1 by rule A and z(j-1) = i-1 then z(j) = i, else z(j)=z(j-1) then z(j) = i, else z(j)=z(j-1)
... P... Pi-i-
11
z(j-1)
j-1j-1:: PPii P Pi+1i+1 ... ...
... P... Pi-1 i-1
PPii
z(j)
jj:: PPi+1i+1 ... ...
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Definition (cont):Definition (cont):
• a a dynamic segmentdynamic segment is a function is a function sszz from indices of computation into segments, from indices of computation into segments, such that such that sszz(j) (j) is a segment inis a segment in jj whose right end is z(j). whose right end is z(j).
... ... PPii
sszz(j)(j)
z(j)
jj::
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Lemma 5:Lemma 5:
Proof:Proof:
Let C =Let C =00 1 1 … be a quiet computation and z a dynamic … be a quiet computation and z a dynamic gap of C. Then g(z(j-1),gap of C. Then g(z(j-1),j-1j-1) = g(z(j),) = g(z(j),jj) for 0 < j < ) for 0 < j < length(C).length(C).
• PPii = = z(j-1)+1 takes a step z(j-1)+1 takes a step
... P... Pi-i-
11
z(j-1)
j-1j-1:: PPii P Pi+1i+1 ... ...
... P... Pi-1 i-1
PPii
z(j)
jj:: PPi+1i+1 ... ...
length > 1length > 1
• PPii z(j-1)+1z(j-1)+1 takes a step - does not affect the gaptakes a step - does not affect the gap
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
• PPii = z(j-1) = z(j-1) takes a step - the segment disappears-takes a step - the segment disappears-contradictioncontradiction
PPii
z(j-1)
g =Lg =Lii-L-Li-1i-1
L’L’i+1i+1== LLi i +1+1
L’L’ii=L=Li-1i-1+1+1
Lemma 6:Lemma 6:
Proof:Proof:
Let C =Let C =00 1 1 … be an infinite quiet computation and z a dynamic … be an infinite quiet computation and z a dynamic gap of C. Then gap of C. Then • there is jthere is j0, such that the state of processor z(j) in 0, such that the state of processor z(j) in j j is 0.g(z) andis 0.g(z) and• there is kthere is k0, such that the state of processor z(k) +1 in 0, such that the state of processor z(k) +1 in k k is 0.u is 0.u for for some u some u
... ... a.*a.*
sz
jj11:: ......
... a.* ... a.* (a+1).g(z)(a+1).g(z)
z(j1)
jj22:: ...... z(j2)
… … 0.g(z)0.g(z)
jj:: ...... z(j)
... at most n-1 times
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Lemma 6 (b):Lemma 6 (b):
Proof:Proof:
Let C =Let C =00 1 1 … be an infinite quiet computation and z a dynamic … be an infinite quiet computation and z a dynamic gap of C. gap of C. Then Then
there is jthere is j0, such that the state of processor z(j) in 0, such that the state of processor z(j) in j j is 0.g(z) is 0.g(z) andand
• there is kthere is k0, such that the state of processor z(k) +1 in 0, such that the state of processor z(k) +1 in k k is 0.u is 0.u
for some u for some u ... ...
sz
jj:: … … PPii 0.g(z’)0.g(z’)
... ... PPii
z’(j)=Pi+1
kk:: 0.g(z’) ...0.g(z’) ... z(k)
sz’
Pi+
1
...sz sz’
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Definition:Definition:
A segment is well formed if all its tags are A segment is well formed if all its tags are equal equal to its gap size.to its gap size.
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Lemma 7:Lemma 7:
Proof:Proof:
Let C =Let C =00 1 1 … be an infinite quiet computation. Then there is j… be an infinite quiet computation. Then there is j0 0
0, 0,such that for all j such that for all j j j0 0 all segments in all segments in j j are well formedare well formed
... ... 0.g(z)0.g(z)
sz
jj11::
... 0.g(z) ... 0.g(z) 1.g(z)1.g(z)
z(j1)=Pi
j’j’11:: z(j’1)=Pi
+1
… … 0.g(z) 1.g(z) … 0.g(z) 1.g(z) … m.g(z)m.g(z)
j’j’mm::
...
jj22::
... 0.g(z) 1.g(z) … 0.g(z) 1.g(z) … *.g(z)*.g(z)
z(j’m)=Pi
+m
z(j2)
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11
Lemma 8:Lemma 8:
Proof:Proof:
There is a point in every infinite computation of S after which There is a point in every infinite computation of S after which every configuration has exactly one segment.every configuration has exactly one segment.
If for all dynamic gaps of C’ g(z) were 0, then there would be only If for all dynamic gaps of C’ g(z) were 0, then there would be only one segmentone segment
… a.0
a.0 ...
If there is some dynamic gap of C’ such that its size is greater If there is some dynamic gap of C’ such that its size is greater than 0:than 0:
... ...
sz
...... z(j1)=Pi
sz’
Pi+1
g(z) g(z) g(z’) and g(z) g(z’) and g(z) 0 0
a.g(z) a.g(z)
0.g(z’) 0.g(z’)
C’ - quiet computation with well formed segments - rule B is voidC’ - quiet computation with well formed segments - rule B is void
PPi+1i+1 can make a step only after P can make a step only after Pii, , but such a step would destroy sbut such a step would destroy szz contradiction contradiction
Conclusion:Conclusion:
Proof:Proof:
The system never livelocks.The system never livelocks.
… a-1.0 a.0
a.0 a+1.0 ...
one well formed segment, g(z) = 0, all tags are 0one well formed segment, g(z) = 0, all tags are 0
After finitely many step the system reaches the following After finitely many step the system reaches the following configuration configuration ::
Hence, Hence, is a legitimate configuration is a legitimate configuration
RecallRecall:: the set of legitimate configurationsthe set of legitimate configurations is the set of all is the set of all cyclic permutations of configurations of the formcyclic permutations of configurations of the form
0.0 1.0 … a-1.0 a.0 0.0 1.0 … a-1.0 a.0 a.0a.0 a+1.0 … n-2.0 for a=0, 1, …, n- a+1.0 … n-2.0 for a=0, 1, …, n-22
::
Rule A: if Rule A: if LLi i L Li-i-11+1 and (L+1 and (Lii0 or T0 or Ti-i-11==0 or T0 or Ti-i-11LLii-L-Li-i-11 or T or Ti-i-11<<TTii) ) then L then Li-i-11.T.Ti-i-11 LLii.T.Tii (L (Li-i-11+1).(L+1).(Lii-L-Li-i-11))
Rule B: if Rule B: if LLi i = L= Li-i-11+1 +1 and Land Lii0 0 and and TTi-i-11 T Tii then L then Li-i-11.T.Ti-i-11 LLii.T.Tii L Lii.T.Ti-i-11