Synchronization - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Synchronization

Description:

CAUSALITY Two events are ordered only if one occurs after the process knows about the other ... If VT(a) VT (b) then a is said to causally precede b ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 10
Provided by: steve1809
Learn more at: http://www.cs.uga.edu
Category:

less

Transcript and Presenter's Notes

Title: Synchronization


1
Synchronization
  • CSCI 4900/6900

2
Causality
  • Lamports algorithm leads to all events being
    ordered irrespective of whether they are
    dependent on each other
  • Example Electronic bulletin board
  • Users may post new articles or respond to
    existing ones
  • No dependence between different threads
  • Lamports algorithm imposes order even between
    independent events
  • CAUSALITY Two events are ordered only if one
    occurs after the process knows about the other

3
Vector Timestamps for Causality
  • Each event is assigned a vector timestamp
  • If VT(a) lt VT (b) then a is said to causally
    precede b
  • Each process maintains a vector Pi maintains Vi
  • Vii Number of events occurred at Pi
  • Vij k then Pi knows that k events have
    occurred at Pj
  • When Pi sends message to Pj, it piggybacks Vi
  • Pj knows about how many events have occurred at
    Pi
  • Pj also knows how many events have occurred at
    other processes
  • Pj adjusts its local vector by setting Vjk
    maxVjk, vtk
  • Increments Vji by 1
  • Delivers a message r only if vt(r) j Vkj
    1 and vt(r) i lt Vki for all i ltgt j

4
Global State
  • Local states of each processes together with
    messages in transit
  • Global states is needed for detecting termination
    conditions/deadlocks
  • Distributed snapshot algorithm (Chandy Lamport)
  • Reflects state where distributed system might
    have been
  • Always represents a consistent global state
  • If it is recorded that a process received a
    message we should have also recorded that the
    message has been sent
  • Distributed snapshots via Cuts

5
Cuts for Global State
  1. A consistent cut
  2. An inconsistent cut

6
Distributed Snapshots Algorithm
  • Assumption Processes are connected via
    uni-directional point-to-point links (channels)
  • Any process (p) may initiate algorithm
  • P records its local state and sends a marker to
    along each outgoing channel
  • Marker indicates that receiver should participate
    in the snapshot algorithm
  • When process Q receives a marker
  • It saves its local state, if it has already not
    done so, and sends marker along each outgoing
    channel
  • If Q had recorded local state, it records the
    state of the channel
  • DONE to indicate that process has done its part

7
Global Snapshots
  1. Organization of a process and channels for a
    distributed snapshot

8
Global State (3)
  • Process Q receives a marker for the first time
    and records its local state
  • Q records all incoming message
  • Q receives a marker for its incoming channel and
    finishes recording the state of the incoming
    channel

9
Termination Detection
  • Detecting the termination of a distributed
    computation
  • Initiator starts the process by sending a marker
    to all processes
  • Each process records its state
  • On completing its part of global snapshots, it
    checks whether there are no messages in transit
  • If no transit messages process sends DONE to
    initiator
  • Else sends CONTINUE
  • Initiator has to restart the detection algorithm
Write a Comment
User Comments (0)
About PowerShow.com