performance of fair distributed mutual exclusion algorithms kandarp jani ajay d. kshemkalyani...

24
Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani Ajay D. Kshemkalyani University of Illinois at Chicago

Upload: caine

Post on 24-Feb-2016

46 views

Category:

Documents


2 download

DESCRIPTION

Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani Ajay D. Kshemkalyani University of Illinois at Chicago. Presentation Plan. Introduction to fair distributed mutual exclusion Previous fair algorithms Lamport ‘78: 3(n-1) msgs/CS - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Performance of Fair Distributed Mutual Exclusion Algorithms

Kandarp Jani Ajay D. Kshemkalyani

University of Illinois at Chicago

Page 2: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Presentation Plan● Introduction to fair distributed mutual exclusion● Previous fair algorithms

1. Lamport ‘78: 3(n-1) msgs/CS2. Ricart-Agrawala (RA) ‘81: 2(n-1) msgs/CS3. Lodha-Kshemkalyani (LK) TPDS‘00: [n, 2n-1] msgs/CS

● Simulation expts study improvement of LK over RA● Conclusion: LK has fewer messages, & lower

waiting time, w/o compromising message size or other metrics

Page 3: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Model and Metrics● Asynchronous distributed message-passing

system– d: time for a message hop

● Metrics for mutual exclusion algorithms1. number of messages/CS2. response time: Ω(2d+css)3. synchronization delay: Ω(d)4. waiting time: Ω(2d)5. throughput: 1/ response time6. fairness7.message size: O(1)

● Single request outstanding at a time

Page 4: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Relating CSS, λ, NCSS, wait time

Page 5: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Fair Mutual Exclusion

• Popular definition of fairness: requests must be answered in the order of their causality-based scalar clock values– If clk(Req1) < clk(Req2):

● Req1 has higher priority– If clk(Req1) = clk(Req2):

● Use requestors’ PIDs as tie-breaker (i.e., define a lexicographic order)

● Only Lamport, RA, and LK algorithms are fair

Page 6: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Ricart-Agrawala Algorithm (1983)

Page 7: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

LK Algorithm (messages)● REQUEST, REPLY, FLUSH messages● REQUEST: contains timestamp of

request● REPLY, FLUSH: contain timestamp of

last completed CS access by sender of message

● Local Request Queue (LRQ): at each process, LRQ tracks concurrent requests

Page 8: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

LK Algorithm (concurrency set)

Message overhead: 2n - |Cset| msgs/CS• (n-1) REQUEST messages• n - |Cset| REPLY messages• 1 FLUSH message

Page 9: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

LK algorithm (REQUEST)● Multiple uses of REQUEST

– to seek permission to enter CS– if requesting concurrently, the REQUEST acts

as a REPLY from the lower priority requestor (i) to the higher priority requester (j)

● j remembers i’s request in its LRQ ● i remembers j’s request in its LRQ● After j finishes CS, i will eventually get logical

permission from j via a chain of REPLY and FLUSH messages

Page 10: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

LK algorithm (REPLY)● REPLY message has timestamp of last

completed CS request of sender of REPLY

● Multiple uses of REPLY– Sender gives individual permission– Sender gives collective permission on

behalf of all processes with higher priority requests

● It acts as multiple logical reply messages

Page 11: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

LK algorithm (FLUSH)• FLUSH sent after exiting CS, to the

concurrently requesting process with the next highest priority

● FLUSH timestamped w/timestamp of just completed CS request of sender of FLUSH

● Multiple uses of FLUSH– Sender gives individual permission– Sender gives collective permission on behalf of

all processes with higher priority requests ● It acts as multiple logical reply messages

Page 12: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Simulation Parameters (on OPNET)

• Input parameters:• Number of processes : n (10-40)• Inter-request time: exp. Distributed, mean λ

(0.1 ms to 10 s)• Critical Section Sitting time: exp. distributed,

mean CSS (0.1 microsec to 10 millisec)• Propagation delay: D, implicitly modeled in CSS

• Output parameters:• Normalized message complexity: M• Waiting time: T

Page 13: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Experiments• Experiment 1:

• M = f(λ), for multiple settings of (n, CSS)• Experiment 2:

• M = f(n), for multiple settings of (CSS, λ)• Experiment 3:

• T = f(n), for multiple settings of (CSS, λ)• compared LK and RA algorithms

Page 14: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of λ on Msg. Ovhd (Expt 1, n=10)

Page 15: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of λ on Msg. Ovhd (Expt 1, n=20)

Page 16: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of λ on Msg. Ovhd (Expt 1, n=30)

Page 17: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of λ on Msg. Ovhd (Expt 1, n=40)

Page 18: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of n on Msg. Ovhd (Expt 2, CSS=0.1 microsec)

Page 19: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of n on Msg. Ovhd (Expt 2, CSS=1 microsec)

Page 20: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of n on Msg. Ovhd (Expt 2, CSS=0.1 ms)

Page 21: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of n on Msg. Ovhd (Expt 2, CSS=1 ms)

Page 22: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of n on Wait Time (Expt 3, CSS=1 microsec)

Page 23: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Impact of n on Wait Time (Expt 3, CSS=0.1 microsec)

Page 24: Performance of Fair Distributed Mutual Exclusion Algorithms Kandarp Jani  Ajay D. Kshemkalyani University of Illinois at Chicago

Conclusions● LK is the best known fair mutex algorithm● LK outperforms Ricart-Agrawala i.t.o.

– Number of messages/CS– Waiting time/CSwithout compromising message size or any

other metric● Studied behaviour of LK using

simulations under a wide range of conditions