c code for lamport algo for mutual exclusion
#1

c code for lamport algo for mutual exclusion
Reply
#2

Lamport's Mutual Exclusion Algorithm

Assumes messages are delivered in FIFO order between each pair of sites
Is not based on tokens
Is based on Lamport's clock synchronization scheme*
Each request gets a timestamp
Requests with lower timestamps take priority over requests with higher timestamps
Each site maintains a queue of pairs (timestamp, site), ordered by timestamp
* Are these the single-integer valued clocks, or the vector clocks?

The Algorithm

Request
Si sends REQUEST(tsi, i) to all sites in its request set Ri and puts the request on request_queuei
when Sj receives REQUEST(tsi, i) from Si it returns a timestamped REPLY to Si and places Si's request on request_queuej
Si waits to start the CS until both
[L1:] Si has received a message with timestamp > (tsi, i) from all other sites
[L2:] Si's request is at the top of request_queuei
Release
Si removes request from top of request_queuei and sends time-stamped RELEASE message to all the sites in its request set
when Sj receives a RELEASE messages from Si it removes Si's request from request_queuej
Correctness

Suppose Si and Sj are executing the CS concurrently.

L1 and L2 must hold at both sites concurrently.

Si and Sj both have requests at top of their queues and L1 holds, at some instant t.

WLOG suppose Si's request has earlier timestamp than Sj's.
(Remember the tie-breaking rule!)

Assuming communication channels are FIFO, at instant t Si's request is queued at Sj, when Sj is in the CS and Sj's own request is at the top of the queue, ahead of a smaller timestamp request.

This is a contradiction.
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: mutual exclusion algorithm by dekker, implementation of lamport algorithm in java code, fault detection exclusion, lamport algorithm in java using socket, latest algo of steganography, hospital management algo, mutual exclusion principle ppt raman,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  java code code for railway anti collision system 1 668 13-02-2018, 11:13 AM
Last Post: dhanabhagya
  mutual funds project report doc free download 1 822 19-09-2017, 12:09 PM
Last Post: jaseela123d
  cancer detection matlab code source code 1 812 08-09-2017, 10:13 AM
Last Post: jaseela123d
  pdf of comparative of hdfc mutual fund 1 644 31-05-2017, 09:19 AM
Last Post: jaseela123d
  mba project on comparative study on mutual fund and bank deposits 1 742 15-05-2017, 09:51 AM
Last Post: jaseela123d
  source code for load balancing algo in cloudsim 1 628 24-04-2017, 12:08 PM
Last Post: jaseela123d
  active noise cancellation code with code compressor studio 1 583 15-04-2017, 03:05 PM
Last Post: jaseela123d
  questionnaire on comparative analysis of reliance and uti mutual funds 1 74 29-09-2016, 09:43 AM
Last Post: ijasti

Forum Jump: