SlideShare a Scribd company logo
1 of 23
Download to read offline
Unit: 5
Distributed Mutual
Exclusion
Dr.Somnath Thigale
Syllabus:
Introduction, Classification of Mutual Exclusion
Algorithms, Preliminaries, A simple solution to
Distributed Mutual Exclusion, Non-Token-Based
Algorithms, Lamport’s Algorithm, The Ricart-
Agrawala Algorithm, Token-Based Algorithms, Suzuki-
Kasami’s Broadcast Algorithms.
Dr.Somnath Thigale
Introduction
Mutual exclusion is a concurrency control property which is
introduced to prevent race conditions. It is the requirement
that a process can not enter its critical section while another
concurrent process is currently present or executing in its
critical section i.e only one process is allowed to execute the
critical section at any given instance of time.
Dr.Somnath Thigale
Classification of Mutual
Exclusion Algorithms
The algorithms are grouped into 2 classes:
1. Token Based Algorithm:
A unique token is shared among all the sites.
If a site possesses the unique token, it is allowed to enter its
critical section
This approach uses sequence number to order requests for the
critical section.
Each requests for critical section contains a sequence number.
This sequence number is used to distinguish old and current
requests.
This approach insures Mutual exclusion as the token is unique
Example: Suzuki-Kasami’s Broadcast Algorithm
Dr.Somnath Thigale
2. Non-token based approach:
A site communicates with other sites in order to determine which
sites should execute critical section next. This requires exchange of
two or more successive round of messages among sites.
This approach use timestamps instead of sequence number to
order requests for the critical section.
When ever a site make request for critical section, it gets a
timestamp. Timestamp is also used to resolve any conflict
between critical section requests.
All algorithm which follows non-token based approach maintains a
logical clock. Logical clocks get updated according to Lamport’s
scheme
Example: Lamport's algorithm, Ricart–Agrawala algorithm
Dr.Somnath Thigale
Preliminaries
System Model:
The system consists of N sites, S1, S2, ..., SN.
- We assume that a single process is running on each site. The process at
site Si is denoted by pi .
- A site can be in one of the following three states: requesting the CS,
executing the CS, or neither requesting nor executing the CS (i.e., idle).
- In the ‘requesting the CS’ state, the site is blocked and can not make
further requests for the CS. In the ‘idle’ state, the site is executing
outside the CS.
- In token-based algorithms, a site can also be in a state where a site
holding the token is executing outside the CS (called the idle token
state).
- At any instant, a site may have several pending requests for CS. A site
queues up these requests and serves them one at a time.
Dr.Somnath Thigale
Requirements of mutual exclusion algorithm:
1. Freedom from deadlock- 2 or more sites should not
endlessly wait for message that will never arrive.
2. Freedom from starvation: a site should not be forced to wait
indefinitely to execute CS while other sites are repeatedly
executing CS.
3. Fairness: request must be executed in the order they are
made
4. Fault tolerance: if in the wake of a failure, it can recognize
itself so that it continues to function without any
(prolonged) disruption.
Dr.Somnath Thigale
A simple solution to Distributed
Mutual Exclusion
A control site is assigned the task of granting
permission for the CS execution.
To request the CS, a site sends a REQUEST message
to the control site.
The control site queues up the requests for the CS
and grants them permission, one by one.
This requires only 3 messages per CS execution.
If the synchronization delay is reduced to T, the
system throughput is almost doubled to 1/(T+E).
Dr.Somnath Thigale
Non-Token-Based Algorithms
In this a site communicates with a set of
other sites to arbitrate who should execute
the CS next.
For a site Si, request set Ri contains ids for
all those sites from which site Si must
acquire permission before entering the CS.
These algorithm use timestamp to order
requests for the CS and to resolve conflicts
between simultaneous requests for the CS.
Dr.Somnath Thigale
Lamport’s algorithm
Dr.Somnath Thigale
Dr.Somnath Thigale
Dr.Somnath Thigale
Dr.Somnath Thigale
Dr.Somnath Thigale
The Ricart-Agrawala algorithm
Dr.Somnath Thigale
Dr.Somnath Thigale
Dr.Somnath Thigale
Dr.Somnath Thigale
Token-Based Algorithms
Dr.Somnath Thigale
Suzuki-Kasami’s Broadcast Algorithms
Dr.Somnath Thigale
Dr.Somnath Thigale
Dr.Somnath Thigale
Dr.Somnath Thigale

More Related Content

Similar to Unit_5_Distributed Mutual Exclusion.pdf

8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
 
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 SystemsIJERA Editor
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.pptBikalAdhikari4
 
Coordination and Agreement .ppt
Coordination and Agreement .pptCoordination and Agreement .ppt
Coordination and Agreement .pptSOURAVKUMAR723356
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlockstech2click
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systemsguest0f5a7d
 
Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)WajeehaBaig
 
Synchronization
SynchronizationSynchronization
SynchronizationSara shall
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OSC.U
 
Mutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.pptMutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.pptShikhaManrai1
 
UNIT IV DIS.pptx
UNIT IV DIS.pptxUNIT IV DIS.pptx
UNIT IV DIS.pptxSamPrem3
 
Advanced os 5th unit
Advanced os 5th unitAdvanced os 5th unit
Advanced os 5th unitMujtaba Ahmed
 
Modeling of distributed mutual exclusion system using event b
Modeling of distributed mutual exclusion system using event bModeling of distributed mutual exclusion system using event b
Modeling of distributed mutual exclusion system using event bcsandit
 
MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B
MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B
MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B cscpconf
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxminaltmv
 

Similar to Unit_5_Distributed Mutual Exclusion.pdf (20)

8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 
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
 
concurrency control.ppt
concurrency control.pptconcurrency control.ppt
concurrency control.ppt
 
Coordination and Agreement .ppt
Coordination and Agreement .pptCoordination and Agreement .ppt
Coordination and Agreement .ppt
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OS
 
OSCh17
OSCh17OSCh17
OSCh17
 
OS_Ch17
OS_Ch17OS_Ch17
OS_Ch17
 
Mutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.pptMutual-Exclusion Algorithm.ppt
Mutual-Exclusion Algorithm.ppt
 
UNIT IV DIS.pptx
UNIT IV DIS.pptxUNIT IV DIS.pptx
UNIT IV DIS.pptx
 
Concurrent control
Concurrent controlConcurrent control
Concurrent control
 
Advanced os 5th unit
Advanced os 5th unitAdvanced os 5th unit
Advanced os 5th unit
 
Modeling of distributed mutual exclusion system using event b
Modeling of distributed mutual exclusion system using event bModeling of distributed mutual exclusion system using event b
Modeling of distributed mutual exclusion system using event b
 
MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B
MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B
MODELING OF DISTRIBUTED MUTUAL EXCLUSION SYSTEM USING EVENT-B
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docx
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Unit_5_Distributed Mutual Exclusion.pdf

  • 2. Syllabus: Introduction, Classification of Mutual Exclusion Algorithms, Preliminaries, A simple solution to Distributed Mutual Exclusion, Non-Token-Based Algorithms, Lamport’s Algorithm, The Ricart- Agrawala Algorithm, Token-Based Algorithms, Suzuki- Kasami’s Broadcast Algorithms. Dr.Somnath Thigale
  • 3. Introduction Mutual exclusion is a concurrency control property which is introduced to prevent race conditions. It is the requirement that a process can not enter its critical section while another concurrent process is currently present or executing in its critical section i.e only one process is allowed to execute the critical section at any given instance of time. Dr.Somnath Thigale
  • 4. Classification of Mutual Exclusion Algorithms The algorithms are grouped into 2 classes: 1. Token Based Algorithm: A unique token is shared among all the sites. If a site possesses the unique token, it is allowed to enter its critical section This approach uses sequence number to order requests for the critical section. Each requests for critical section contains a sequence number. This sequence number is used to distinguish old and current requests. This approach insures Mutual exclusion as the token is unique Example: Suzuki-Kasami’s Broadcast Algorithm Dr.Somnath Thigale
  • 5. 2. Non-token based approach: A site communicates with other sites in order to determine which sites should execute critical section next. This requires exchange of two or more successive round of messages among sites. This approach use timestamps instead of sequence number to order requests for the critical section. When ever a site make request for critical section, it gets a timestamp. Timestamp is also used to resolve any conflict between critical section requests. All algorithm which follows non-token based approach maintains a logical clock. Logical clocks get updated according to Lamport’s scheme Example: Lamport's algorithm, Ricart–Agrawala algorithm Dr.Somnath Thigale
  • 6. Preliminaries System Model: The system consists of N sites, S1, S2, ..., SN. - We assume that a single process is running on each site. The process at site Si is denoted by pi . - A site can be in one of the following three states: requesting the CS, executing the CS, or neither requesting nor executing the CS (i.e., idle). - In the ‘requesting the CS’ state, the site is blocked and can not make further requests for the CS. In the ‘idle’ state, the site is executing outside the CS. - In token-based algorithms, a site can also be in a state where a site holding the token is executing outside the CS (called the idle token state). - At any instant, a site may have several pending requests for CS. A site queues up these requests and serves them one at a time. Dr.Somnath Thigale
  • 7. Requirements of mutual exclusion algorithm: 1. Freedom from deadlock- 2 or more sites should not endlessly wait for message that will never arrive. 2. Freedom from starvation: a site should not be forced to wait indefinitely to execute CS while other sites are repeatedly executing CS. 3. Fairness: request must be executed in the order they are made 4. Fault tolerance: if in the wake of a failure, it can recognize itself so that it continues to function without any (prolonged) disruption. Dr.Somnath Thigale
  • 8. A simple solution to Distributed Mutual Exclusion A control site is assigned the task of granting permission for the CS execution. To request the CS, a site sends a REQUEST message to the control site. The control site queues up the requests for the CS and grants them permission, one by one. This requires only 3 messages per CS execution. If the synchronization delay is reduced to T, the system throughput is almost doubled to 1/(T+E). Dr.Somnath Thigale
  • 9. Non-Token-Based Algorithms In this a site communicates with a set of other sites to arbitrate who should execute the CS next. For a site Si, request set Ri contains ids for all those sites from which site Si must acquire permission before entering the CS. These algorithm use timestamp to order requests for the CS and to resolve conflicts between simultaneous requests for the CS. Dr.Somnath Thigale