Termination detection
This presentation is the property of its rightful owner.
Sponsored Links
1 / 28

Termination Detection PowerPoint PPT Presentation


  • 85 Views
  • Uploaded on
  • Presentation posted in: General

Termination Detection. Presented by: Yonni Edelist. The model. A finite graph of machines (nodes) and communication channels (edges), in which a distributed computation is taking place Machines can be either ‘ active ’ or ‘ passive ’ Only active machines may send messages

Download Presentation

Termination Detection

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Termination detection

Termination Detection

Presented by:

Yonni Edelist


The model

The model

  • A finite graph of machines (nodes) and communication channels (edges), in which a distributed computation is taking place

  • Machines can be either ‘active’ or ‘passive’

  • Only active machines may send messages

  • Passive machine may become active only when it receives a message

  • Active machine may become passive at any time


The model example

The model- example

0

2

3

1

6

5

4


The problem

The problem

  • If, in the computation, a finite number of messages are sent, the graph will reach a stable state in which no more messages are sent

  • One machine, say machine no. 0, wants to detect that the graph has reached that state

  • We will build an algorithm which enables machine 0 to detect termination


Example

example

  • We denote messages sent by the termination detection algorithm ‘signals’

0

2

3

1

6

5

4


Termination detection in a ring

Termination detection in a ring


The model1

The model

  • N machines, 0..N-1

  • Machine 0 initiates the detection algorithm

  • Does so by sending a signal (a token) to machine 1

  • Machine i can propagate the token to machine i+1

  • We denote the machine currently holding the token ‘t’


System invariant

System Invariant

  • We describe an invariant, which will be true for every configuration of the system (for every value of t)

  • Machine 0 will know that all other machines are passive based on:

    • t=0

    • The invariant

    • (possibly) further information available at machine 0


First invariant p0

First Invariant- P0

  • First step- we assume that there are no messages

  • Meaning: an active node may become passive, but not vice-versa

  • P0: (∀ i: 0≤i<t machine i is passive)


P0 example

P0- Example

0

3

1

2

Red outline represents an active machine


Rule 0

Rule 0

  • In order to preserve the invariant, we must follow the rule:

  • Rule 0: Machine i transmits the token only if it’s passive

  • (remember that a passive machine can’t become active again)


Rule 0 example

Rule 0- Example

0

3

1

2


But what if a message is sent

But what if a message is sent?

0

3

1

2


Invariant p1

Invariant P1

  • If machine i<t receives a message, it becomes active, thus falsifying P0

  • Message must have been sent by machine j≥t

  • P1 is established whenever P0 is falsified in the above manner

P0: (∀ i: 0≤i<t machine i is passive)


Invariant p1 cont

Invariant P1 (cont.)

  • A machine can be either black or white

  • P1: (∃ j: t ≤ j ≤ N: machine j is black)

  • Rule 1: When machine j sends a message to machine i<j, it becomes black


Rule 1 example

Rule 1- Example

0

3

1

2


Invariant p1 cont1

Invariant P1 (cont.)

  • Now P= P0 ∨ P1 is not falsified when a message is sent to i < j.

  • Machine 0 knows:

  • (t=0 ∧ machine 0 is white)  ¬P1

  • P0: (∀ i: 0≤i<t machine i is passive)

  • Therefore- machine 0 can still detect termination


Termination detection

But…

0

3

1

2


Invariant p2

Invariant P2

  • P1 may be falsified when a black machine hands the token over

  • We want to ensure that every token propagation that falsifies P1 establishes P2

  • We define that the token may be either black or white


Invariant p2 cont

Invariant P2 (cont)

  • P2: the token is black

  • And the accompanying rule:

  • Rule 2: A black machine transmits a black token. A white machine doesn’t change the colour of the token


Invariant p2 cont1

Invariant P2 (cont)

  • Machine 0 knows:

  • (t=0 ∧ machine 0 is white)  ¬P1

    -Token is white  ¬P2

  • P0: (∀ i: 0≤i<t machine i is passive)

  • Therefore- machine 0 can still detect termination


Invariant p2 example

Invariant P2- Example

0

3

1

2


Rule 3

Rule 3

  • The algorithm may finish unsuccessfully

  • Rule 3: after an unsuccessful round, machine 0 initiates another round


Termination detection

But…

0

3

1

2


Rule 4

Rule 4

  • Since a round that begun with a black token is doomed, we adopt:

  • Rule 4: at the beginning of a new round, machine 0 makes itself white and transmits a white token


Still not good enough

Still not good enough

0

3

1

2


Rule 5

Rule 5

  • Whitening a black machine i may falsify only P1, and only in the case i > t

  • Rule 5: when transmitting the token to machine i+1, machine i makes itself white

P1: (∃ j: t ≤ j ≤ N: machine j is black)


Final example

Final example

0

3

1

2


  • Login