Mutual Exclusion - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Mutual Exclusion

Description:

6. Maekawa's Voting Algorithm. Each process pi has a voting set Vi of size K. K. n pi Vi. All pairs of voting sets share at least one element ... – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 15
Provided by: scie216
Category:
Tags: exclusion | mutual | size

less

Transcript and Presenter's Notes

Title: Mutual Exclusion


1
Mutual Exclusion
2
Critical Section Problem
  • acquire(c)
  • CriticalSection c
  • release(c)
  • Critical Section correctness
  • Mutual Exclusion safety (ME1)
  • Deadlock-Freedom liveness (ME2)
  • Starvation-Freedom fairness (ordering,ME3)

3
Analysis of Distributed ME Algs
  • Bandwidth usage
  • Client Delay
  • Throughput

4
Algorithms
  • Centralized algorithm
  • Token Ring algorithm
  • Distributed algorithm
  • Voting algorithm

5
Distributed Algorithm
  • No leader process
  • Need total order on messages
  • Broadcast all messages
  • Lamports timestamps
  • Two message types
  • request(P,c,ts) P requests CS c at time ts
  • acquire(P,Q,c) Q permits P to enter c
  • P acquires c all proc permit P to enter c

6
Maekawas Voting Algorithm
  • Each process pi has a voting set Vi of size K
  • K ? ?n
  • pi ? Vi
  • All pairs of voting sets share at least one
    element
  • Each process pi is contained in K voting sets

7
Questions (1/3)
  • Which distributed ME algorithm provides
  • Fairness?
  • Liveness?
  • Which distributed ME algorithm uses the least
    bandwidth?
  • Which distributed ME algorithm uses the most
    bandwidth?

8
Questions (2/3)
  • Which distributed ME alg can handle failure the
    easiest?
  • Which type of failure can none of the distributed
    ME algorithms recover from if run in an
    asynchronous distributed system?
  • If processes continually (or frequently) need to
    enter the CS, which algorithm would you recommend?

9
Questions (3/3)
  • If CS entry requests are sporadic, which
    algorithm would you recommend?
  • Why can voting algorithms handle failure of
    processes easier than other algorithms?

10
Leader Election
  • Section 12.3

11
Leader Election
  • Many distributed tasks need a coordinator
  • Eg clock synchronization
  • If all processes identical cannot elect leader
  • Assume each process has unique identifier
  • Elect process with largest identifier

12
Ring Algorithm (for process i)
  • if (leader down)
  • Leader ? send Election, i
  • receive Election,j
  • if (ij) send LeaderElected, i Leader i
  • else if (j gt i) send Election,j Leader ?
  • else if (Leader ? ? ) send Election, i
    Leader ?
  • receive LeaderElected, j
  • if (i ? j) send LeaderElected, j Leader j

13
Bully algorithm
  • P gets no response from current leader
  • P sends election message to processes with higher
    id
  • If no responses
  • P is new leader
  • P sends leader message to all
  • If higher-up Q receives election message
  • Q sends bully message to P
  • Q sends election message to higher-ups

14
Questions
  • Why can we not elect a leader if all processes
    are identical?
  • Which of the two leader election algorithms
    discussed can tolerate failure best?
  • Which leader election algorithms uses the least
    bandwidth?
Write a Comment
User Comments (0)
About PowerShow.com