SlideShare a Scribd company logo
Clock Synchronization
Physical Clocks
1 The time difference between two computers is known as drift. Clock drift
over time is known as skew.
2
Logical Clocks
Often, it is not necessary for a computer to know the exact time, only relative time.
This is known as “logical time”.
Logical time is not based on timing but on the ordering of events.
Non-interacting processes cannot share a logical clock.
Computers generally obtain logical time using interrupts to update a software clock.
The more interrupts (the more frequently time is updated), the higher the overhead.
Process Synchroniztion
Process synchronization is the set of techniques that are used to coordinate
execution among processes. For example, a process may need to run to a certain
point, at which point it will stop and wait for another process to finish certain
actions. A shared resource, such as a file or fields in a database, may require
exclusive access and processes have to coordinate among themselves to ensure that
access to the resource is fair and exclusive.
Distributed processes often need to coordinate their activities.
If a collection of processes share a resource or collection of resources, then often
mutual exclusion is required to prevent interference and ensure consistency when
accessing the resources.
Critical Section (CS)
enter(): enter a critical section - block if necessary.
resourceAccess(): access shared resources in critical section.
exit(): leave critical section - other processes may now enter.
In computer science, mutual exclusion (MUTEX) refers to a way of making sure that
if one process is using shared modifiable data or resources then the other processes
will be excluded from doing the same thing at the same time. A number of mutual
exclusion algorithms are available in the literature, with different performance
metrics and with different techniques. The Selection for a “good” mutual exclusion
algorithm is a key point. These mutual exclusion algorithms can be broadly
classified into token and non-token based algorithm.
Distributed Mutual Exclusion
Any viable mutual exclusion algorithm must satisfy three properties:
Safety
At any instant, only one process may hold the resource.
Liveness
Processes should not wait forever for messages that will never arrive.
Ordering
If one request to enter the CS happened-before another, then entry to the CS is
granted in that order.
1. Token based approaches
 A unique token (PRIVILEGE msg) is shared among the processes.
 A process is allowed to enter its CS if it possesses the token.
 Centralized Algorithm
 Ring Based Algorithms
Centralized Algorithm
One process is elected as the coordinator.
When any process wants to enter a critical section, it sends a request message to the
coordinator stating which critical section it wants to access.
If no other process is currently in that critical section, the coordinator sends back a
reply granting permission. When the reply arrives, the requesting process enters the
critical section. If another process requests access to the same critical section, it is
ignored or blocked until the first process exits the critical section and sends a
message to the coordinator stating that it has exited.
Ring Based Algorithms
Another approach is to create a logical or physical ring.
Each process knows the identity of the process succeeding it.
When the ring is initialized, Process 0 is given a token. The token circulates around
the ring in order, from Process k to Process k + 1.
When a process receives the token from its neighbor, it checks to see if it is
attempting to enter a critical section. If so, the process enters the critical section and
does its work, keeping the token the whole time.
After the process exits the critical section, it passes the token to the next process in
the ring. It is not permitted to enter a second critical section using the same token.
If a process is handed a token an is not interested in entering a critical section, it
passes the token to the next process.
Distributed Algorithms
It is often unacceptable to have a single point of failure. Therefore researchers
continue to look for distributed mutual exclusion algorithms.
2. Non Token based approaches
Two or more successive rounds of messages are exchanged among the processes
to determine which process will enter the CS next.
Lamport’s mutual exclusion algorithm
• In this algorithm, every process in the group maintains a request queue.
There is a list of processes (p1,p2,p3) that want to access a resource.
• All messages are sent reliably and in FIFO order and each message is time
stamped with unique Lamport timestamps. All items in the request queues
are sorted by message timestamps.
• The basic mechanism of this algorithm is that a process that wants to use the
resource sends a timestamped request for the resource to all group members
as well as to itself.
• Every recipient adds the received request to its request queue, which is sorted
in timestamp order. Because all processes get all request messages, all
timestamps are unique, and all queues are sorted, every process has the exact
same items on its queue.
• If a process sees itself at the head of the queue, it knows that it can access the
resource: no other process will be at the head of the queue.
• When it is done, it sends a release message to all group members and removes
its ID from its local queue.
• Each group member, upon receiving a release message, removes that process
ID from the request queue and checks to see whether it is at the head of the
queue and can access the resource.
Distributed Mutual exclusion algorithms
• Lamport’s algorithm is not a great one. We replaced the single point of failure
of the centralized algorithm with an algorithm that has N points of failure.
• In addition, there is a lot of messaging traffic. Each request requires sending
N–1 messages (one to each group member) and getting N–1
acknowledgements.
• Finally, when a resource lock is released, a process must send N–1 release
messages.
Ricart and Agrawala:
• There must be a total ordering of all events in the system. Lamport’s
Algorithm can be used for this purpose.
• When a process wants to enter a critical section, it builds a message
containing the name of the critical section, its process number, and the
current time. It then sends the message (broadcast) to all other processes, as
well as to itself.
1 When a process receives a request message, the action it takes depends on its
state with respect to the critical section named in the message.
2
There are three cases:
1. If the receiver is not in the critical section and does not want to enter it, it
sends an OK message to the sender.
2. If the receiver is in the critical section, it does not reply. It instead queues the
request.
3. If the receiver also wants to enter the same critical section, it compares the
time stamp in the incoming message with the time stamp in the message it has sent
out. The lowest time stamp wins. If its own message has a lower time stamp, it does
not reply and queues the request from the sending process.
When a process has received OK messages from all other processes, it enters the
critical section. Upon exiting the critical section, it sends OK messages to all
processes in its queue and deletes them all from the queue.
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
Ad

More Related Content

What's hot (20)

Process synchronization
Process synchronizationProcess synchronization
Process synchronization
Syed Hassan Ali
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
Dilum Bandara
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
Maulik Togadiya
 
Group Communication (Distributed computing)
Group Communication (Distributed computing)Group Communication (Distributed computing)
Group Communication (Distributed computing)
Sri Prasanna
 
Stream oriented communication
Stream oriented communicationStream oriented communication
Stream oriented communication
Shyama Bhuvanendran
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
pinki soni
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
United International University
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
Sunita Sahu
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)
Vicky Tyagi
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar
 
GOOGLE FILE SYSTEM
GOOGLE FILE SYSTEMGOOGLE FILE SYSTEM
GOOGLE FILE SYSTEM
JYoTHiSH o.s
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
Pritom Saha Akash
 
Parallel computing
Parallel computingParallel computing
Parallel computing
Vinay Gupta
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed Computing
Richa Singh
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
Meghaj Mallick
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
Meghaj Mallick
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
selvakumar_b1985
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
Student
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
Md. Mahedi Mahfuj
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
Dilum Bandara
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
Maulik Togadiya
 
Group Communication (Distributed computing)
Group Communication (Distributed computing)Group Communication (Distributed computing)
Group Communication (Distributed computing)
Sri Prasanna
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
pinki soni
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
United International University
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
Sunita Sahu
 
Planning in AI(Partial order planning)
Planning in AI(Partial order planning)Planning in AI(Partial order planning)
Planning in AI(Partial order planning)
Vicky Tyagi
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar
 
GOOGLE FILE SYSTEM
GOOGLE FILE SYSTEMGOOGLE FILE SYSTEM
GOOGLE FILE SYSTEM
JYoTHiSH o.s
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
Pritom Saha Akash
 
Parallel computing
Parallel computingParallel computing
Parallel computing
Vinay Gupta
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed Computing
Richa Singh
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
Meghaj Mallick
 
Query processing in Distributed Database System
Query processing in Distributed Database SystemQuery processing in Distributed Database System
Query processing in Distributed Database System
Meghaj Mallick
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
selvakumar_b1985
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
Student
 

Similar to Distributed Mutual exclusion algorithms (20)

Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
guest61205606
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
guest0f5a7d
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
guest61205606
 
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed SystemsComparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
IJERA Editor
 
Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...
Govt. P.G. College Dharamshala
 
Synchronization
SynchronizationSynchronization
Synchronization
Sara shall
 
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdfDC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
LegesseSamuel
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docx
minaltmv
 
Process management in Operating System_Unit-2
Process management in Operating System_Unit-2Process management in Operating System_Unit-2
Process management in Operating System_Unit-2
mohanaps
 
Process coordination
Process coordinationProcess coordination
Process coordination
Sweta Kumari Barnwal
 
Lecture 3 Inter Process Communication.pptx
Lecture 3 Inter Process Communication.pptxLecture 3 Inter Process Communication.pptx
Lecture 3 Inter Process Communication.pptx
HarrisChikunya
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OS
C.U
 
OSCh17
OSCh17OSCh17
OSCh17
Joe Christensen
 
OS_Ch17
OS_Ch17OS_Ch17
OS_Ch17
Supriya Shrivastava
 
Lecture 5 inter process communication
Lecture 5 inter process communicationLecture 5 inter process communication
Lecture 5 inter process communication
Kumbirai Junior Muzavazi
 
A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...
A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...
A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...
Neelamani Samal
 
dos mutual exclusion algos
dos mutual exclusion algosdos mutual exclusion algos
dos mutual exclusion algos
Akhil Sharma
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptx
MArshad35
 
operating system notes of unit 3 explanation
operating system notes of unit 3 explanationoperating system notes of unit 3 explanation
operating system notes of unit 3 explanation
yashkushwah671
 
Advanced os 5th unit
Advanced os 5th unitAdvanced os 5th unit
Advanced os 5th unit
Mujtaba Ahmed
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
guest61205606
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
guest0f5a7d
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
guest61205606
 
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed SystemsComparative Study of Mutual Exclusion Algorithms in Distributed Systems
Comparative Study of Mutual Exclusion Algorithms in Distributed Systems
IJERA Editor
 
Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...Analysis of mutual exclusion algorithms with the significance and need of ele...
Analysis of mutual exclusion algorithms with the significance and need of ele...
Govt. P.G. College Dharamshala
 
Synchronization
SynchronizationSynchronization
Synchronization
Sara shall
 
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdfDC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
DC Lecture 04 and 05 Mutual Excution and Election Algorithms.pdf
LegesseSamuel
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docx
minaltmv
 
Process management in Operating System_Unit-2
Process management in Operating System_Unit-2Process management in Operating System_Unit-2
Process management in Operating System_Unit-2
mohanaps
 
Lecture 3 Inter Process Communication.pptx
Lecture 3 Inter Process Communication.pptxLecture 3 Inter Process Communication.pptx
Lecture 3 Inter Process Communication.pptx
HarrisChikunya
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OS
C.U
 
A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...
A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...
A fault tolerant tokenbased atomic broadcast algorithm relying on responsive ...
Neelamani Samal
 
dos mutual exclusion algos
dos mutual exclusion algosdos mutual exclusion algos
dos mutual exclusion algos
Akhil Sharma
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptx
MArshad35
 
operating system notes of unit 3 explanation
operating system notes of unit 3 explanationoperating system notes of unit 3 explanation
operating system notes of unit 3 explanation
yashkushwah671
 
Advanced os 5th unit
Advanced os 5th unitAdvanced os 5th unit
Advanced os 5th unit
Mujtaba Ahmed
 
Ad

More from MNM Jain Engineering College (17)

IT8602 MOBILE COMMUNICATION.docx
IT8602 MOBILE COMMUNICATION.docxIT8602 MOBILE COMMUNICATION.docx
IT8602 MOBILE COMMUNICATION.docx
MNM Jain Engineering College
 
IT8602 Syllabus.pdf
IT8602 Syllabus.pdfIT8602 Syllabus.pdf
IT8602 Syllabus.pdf
MNM Jain Engineering College
 
Mg8591 syllabus
Mg8591 syllabusMg8591 syllabus
Mg8591 syllabus
MNM Jain Engineering College
 
Ccse ii model_qp
Ccse ii model_qpCcse ii model_qp
Ccse ii model_qp
MNM Jain Engineering College
 
Task assignment approach
Task assignment approachTask assignment approach
Task assignment approach
MNM Jain Engineering College
 
Process Management-Process Migration
Process Management-Process MigrationProcess Management-Process Migration
Process Management-Process Migration
MNM Jain Engineering College
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
MNM Jain Engineering College
 
Peer to Peer services and File systems
Peer to Peer services and File systemsPeer to Peer services and File systems
Peer to Peer services and File systems
MNM Jain Engineering College
 
Remote method invocation
Remote method invocationRemote method invocation
Remote method invocation
MNM Jain Engineering College
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
MNM Jain Engineering College
 
Engineering Ethics
Engineering EthicsEngineering Ethics
Engineering Ethics
MNM Jain Engineering College
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
MNM Jain Engineering College
 
It6312 dbms lab-ex2
It6312 dbms lab-ex2It6312 dbms lab-ex2
It6312 dbms lab-ex2
MNM Jain Engineering College
 
Expected questions in Artificial Intelligence
Expected questions in Artificial IntelligenceExpected questions in Artificial Intelligence
Expected questions in Artificial Intelligence
MNM Jain Engineering College
 
Qp mobile & pervasive 2015
Qp mobile & pervasive 2015Qp mobile & pervasive 2015
Qp mobile & pervasive 2015
MNM Jain Engineering College
 
It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2
MNM Jain Engineering College
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
MNM Jain Engineering College
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
MNM Jain Engineering College
 
It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2It6611 mobile application development laboratory l t p c0 0 3 2
It6611 mobile application development laboratory l t p c0 0 3 2
MNM Jain Engineering College
 
Ad

Recently uploaded (20)

Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control Monthly May 2025
Water Industry Process Automation & Control
 
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Journal of Soft Computing in Civil Engineering
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
IJCNCJournal
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Surveying through global positioning system
Surveying through global positioning systemSurveying through global positioning system
Surveying through global positioning system
opneptune5
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
IJCNCJournal
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
 
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Surveying through global positioning system
Surveying through global positioning systemSurveying through global positioning system
Surveying through global positioning system
opneptune5
 

Distributed Mutual exclusion algorithms

  • 1. Clock Synchronization Physical Clocks 1 The time difference between two computers is known as drift. Clock drift over time is known as skew. 2 Logical Clocks Often, it is not necessary for a computer to know the exact time, only relative time. This is known as “logical time”. Logical time is not based on timing but on the ordering of events. Non-interacting processes cannot share a logical clock. Computers generally obtain logical time using interrupts to update a software clock. The more interrupts (the more frequently time is updated), the higher the overhead.
  • 2. Process Synchroniztion Process synchronization is the set of techniques that are used to coordinate execution among processes. For example, a process may need to run to a certain point, at which point it will stop and wait for another process to finish certain actions. A shared resource, such as a file or fields in a database, may require exclusive access and processes have to coordinate among themselves to ensure that access to the resource is fair and exclusive. Distributed processes often need to coordinate their activities. If a collection of processes share a resource or collection of resources, then often mutual exclusion is required to prevent interference and ensure consistency when accessing the resources. Critical Section (CS) enter(): enter a critical section - block if necessary. resourceAccess(): access shared resources in critical section. exit(): leave critical section - other processes may now enter. In computer science, mutual exclusion (MUTEX) refers to a way of making sure that if one process is using shared modifiable data or resources then the other processes will be excluded from doing the same thing at the same time. A number of mutual exclusion algorithms are available in the literature, with different performance metrics and with different techniques. The Selection for a “good” mutual exclusion algorithm is a key point. These mutual exclusion algorithms can be broadly classified into token and non-token based algorithm. Distributed Mutual Exclusion Any viable mutual exclusion algorithm must satisfy three properties: Safety At any instant, only one process may hold the resource. Liveness Processes should not wait forever for messages that will never arrive. Ordering If one request to enter the CS happened-before another, then entry to the CS is granted in that order.
  • 3. 1. Token based approaches  A unique token (PRIVILEGE msg) is shared among the processes.  A process is allowed to enter its CS if it possesses the token.  Centralized Algorithm  Ring Based Algorithms Centralized Algorithm One process is elected as the coordinator. When any process wants to enter a critical section, it sends a request message to the coordinator stating which critical section it wants to access. If no other process is currently in that critical section, the coordinator sends back a reply granting permission. When the reply arrives, the requesting process enters the critical section. If another process requests access to the same critical section, it is ignored or blocked until the first process exits the critical section and sends a message to the coordinator stating that it has exited. Ring Based Algorithms Another approach is to create a logical or physical ring. Each process knows the identity of the process succeeding it. When the ring is initialized, Process 0 is given a token. The token circulates around the ring in order, from Process k to Process k + 1. When a process receives the token from its neighbor, it checks to see if it is attempting to enter a critical section. If so, the process enters the critical section and does its work, keeping the token the whole time.
  • 4. After the process exits the critical section, it passes the token to the next process in the ring. It is not permitted to enter a second critical section using the same token. If a process is handed a token an is not interested in entering a critical section, it passes the token to the next process. Distributed Algorithms It is often unacceptable to have a single point of failure. Therefore researchers continue to look for distributed mutual exclusion algorithms. 2. Non Token based approaches Two or more successive rounds of messages are exchanged among the processes to determine which process will enter the CS next. Lamport’s mutual exclusion algorithm • In this algorithm, every process in the group maintains a request queue. There is a list of processes (p1,p2,p3) that want to access a resource. • All messages are sent reliably and in FIFO order and each message is time stamped with unique Lamport timestamps. All items in the request queues are sorted by message timestamps. • The basic mechanism of this algorithm is that a process that wants to use the resource sends a timestamped request for the resource to all group members as well as to itself. • Every recipient adds the received request to its request queue, which is sorted in timestamp order. Because all processes get all request messages, all timestamps are unique, and all queues are sorted, every process has the exact same items on its queue.
  • 5. • If a process sees itself at the head of the queue, it knows that it can access the resource: no other process will be at the head of the queue. • When it is done, it sends a release message to all group members and removes its ID from its local queue. • Each group member, upon receiving a release message, removes that process ID from the request queue and checks to see whether it is at the head of the queue and can access the resource.
  • 7. • Lamport’s algorithm is not a great one. We replaced the single point of failure of the centralized algorithm with an algorithm that has N points of failure. • In addition, there is a lot of messaging traffic. Each request requires sending N–1 messages (one to each group member) and getting N–1 acknowledgements. • Finally, when a resource lock is released, a process must send N–1 release messages. Ricart and Agrawala: • There must be a total ordering of all events in the system. Lamport’s Algorithm can be used for this purpose. • When a process wants to enter a critical section, it builds a message containing the name of the critical section, its process number, and the current time. It then sends the message (broadcast) to all other processes, as well as to itself. 1 When a process receives a request message, the action it takes depends on its state with respect to the critical section named in the message. 2
  • 8. There are three cases: 1. If the receiver is not in the critical section and does not want to enter it, it sends an OK message to the sender. 2. If the receiver is in the critical section, it does not reply. It instead queues the request. 3. If the receiver also wants to enter the same critical section, it compares the time stamp in the incoming message with the time stamp in the message it has sent out. The lowest time stamp wins. If its own message has a lower time stamp, it does not reply and queues the request from the sending process. When a process has received OK messages from all other processes, it enters the critical section. Upon exiting the critical section, it sends OK messages to all processes in its queue and deletes them all from the queue.
  翻译: