Global state collection - PowerPoint PPT Presentation

About This Presentation
Title:

Global state collection

Description:

... process engages another process. ... down the edge when it engages. another node. At a 'suitable time, ... The engagement edges form a spanning tree. The tree ... – PowerPoint PPT presentation

Number of Views:11
Avg rating:3.0/5.0
Slides: 12
Provided by: Sukuma7
Category:

less

Transcript and Presenter's Notes

Title: Global state collection


1
Global state collection
  • Chandy Lamport algorithm does a partial job.
    Each process collects a fragment of the global
    state, but these pieces have to be put together.
  • Applications
  • - computing network topology
  • - termination detection
  • - deadlock detection
  • etc

2
A simple exercise
  • Collect global state
  • via all-to-all broadcast
  • At the end, each process
  • will compute a set V, where
  • V s(i) 0 i N-1

s(i)
s(j)
i
j
s(k)
s(l)
k
l
3
A simple exercise
  • Program broadcast (for process i
  • define V.i, W.i set of values
  • initially V.is(i), W.i ??
  • ?and?every channel is empty?
  • do V.i ? W.i? send (V.i \ W.i) to every outgoing
    channel W.i V.i
  • ? empty (k, i)? receive X from channel (k, i)
    V.i V.i ? X
  • od

V.i W.i
V.k W.k
(i,k)
4
Proof
  • empty (i. k) ? W.i ?? V.k.
  • (Upon termination) ?i V.i W.i,
  • and all channels are empty.
  • So, V.i ?? V.k.
  • On a cyclic path, V.i V.k must be
  • true. Since s(i) ??V.i, s(i) ??V.k

V.i W.i
V.k W.k
(i,k)
5
Termination detection
  • In a network, processes may be active or passive.
  • Termination implies
  • (a) every process is passive,
  • (b) all channels are empty, and
  • (c) the global state of the system satisfies
    the
  • desired postcondition

6
Termination detection
The progress of a computation. Notice how one
process engages another process. Eventually All
processes turn white - this signals termination.
7
Dijkstra-Scholten algorithm
  • An initiator initiates termination
  • detection by sending a signal
  • down the edge when it engages
  • another node.
  • At a suitable time, the recipient
  • sends an ack back.
  • When the initiator receives ack, it
  • detects termination.
  • Node j engages node k.

j
k
j
k
j
k
8
Dijkstra-Scholten algorithm
  • Deficit (e) of signals on e - of ack on e
  • For any node,
  • C deficit along incoming edges
  • D deficit along outgoing edges edges
  • Invariant 1. (C 0) ? (D 0)
  • Invariant 2. (C gt 0) ? (D 0)

0
1
2
3
4
5
9
Dijkstra-Scholten algorithm
  • Invariant 1. (C 0) ? (D 0)
  • Invariant 2. (C gt 0) ? (D 0)
  • The invariants must hold when
  • an interim node sends an ack.
  • So
  • (C-1 0) ? (C-1gt 0 ??D0)
  • follows from INV1 and INV2
  • (Cgt1) ?? (C1 ? D0)
  • (Cgt1) ??(C1 ? D0)

0
1
2
3
4
5
10
Dijkstra-Scholten algorithm
  • program detect for an internal node i
  • initially C0, D0, parent i
  • do m signal ? (C0) ?
  • C1 state active parent sender
  • m ack ? D D-1
  • (C1? D0) ? state passive ?
  • send ack to parent C 0 parent i
  • m signal ? (C1) ?
  • send ack to the sender
  • od

0
1
2
3
4
5
11
Dijkstra-Scholten algorithm
  • The engagement edges form a spanning tree. The
    tree grows and shrinks.
  • Signals are acknowledged on very-first-in-very-las
    t-out basis
  • Termination is detected when the initiator
    receives ack.

0
1
2
3
4
5
Write a Comment
User Comments (0)
About PowerShow.com