0% found this document useful (0 votes)
3 views17 pages

Distributed Mutual Exclusion

The document discusses distributed mutual exclusion, defining it as a condition where multiple processes cannot access a critical section simultaneously. It contrasts mutual exclusion in single-computer systems with distributed systems, highlighting the challenges posed by the lack of shared memory. The document also outlines the classification of mutual exclusion algorithms, performance metrics, and a simple solution involving a control site for managing requests.

Uploaded by

jainaryanjain30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views17 pages

Distributed Mutual Exclusion

The document discusses distributed mutual exclusion, defining it as a condition where multiple processes cannot access a critical section simultaneously. It contrasts mutual exclusion in single-computer systems with distributed systems, highlighting the challenges posed by the lack of shared memory. The document also outlines the classification of mutual exclusion algorithms, performance metrics, and a simple solution involving a control site for managing requests.

Uploaded by

jainaryanjain30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Distributed Mutual Exclusion

Learning Outcome

At the end of this session,


• Students will be able to uniquely identify the mutual
exclusion in distributed system environment.

Walchand Institute of Technology, Solapur 2


What is mutual exclusion?
• When a process is accessing a shared variable, the process is said to
be in a CS (critical section).
• When no two processes can be in the same CS at the same time, this is
called as a mutual exclusion.

Walchand Institute of Technology, Solapur 3


Mutual Exclusion : Introduction
• Resources in a system that must not be used simultaneously by
multiple processes.
• Exclusive access to such a shared resource by a process must be
insured.
• The sections of a program that need exclusive access to shared
resources are referred as critical sections.

Walchand Institute of Technology, Solapur 4


Mutual exclusion in Single-computer systems vs.
Distributed systems
• In single-computer systems, the status of a shared resource and the
status of users is readily available in the shared memory and
solutions to the mutual exclusion problem can be easily
implemented using shared variables (e.g., semaphores).

• In distributed systems, both the shared resources and the users may
be distributed and shared memory does not exist.

Walchand Institute of Technology, Solapur 5


The Classification of Mutual Exclusion Algorithms

• These algorithms can be grouped into two classes:


1. Non-token-based Algorithms
e.g. Lamports, Ricart-Agarwala
2. Token based Algorithms
e.g. Suzuki-Kasami

• We solve distributed mutual exclusion with message passing.

Walchand Institute of Technology, Solapur 6


Distributed Mutual Exclusion: Preliminaries

•System Model: At any instant, a site may have several requests for CS.
A site queues up these requests and serves them one at a time.

• A site can be in one of the following three states:


requesting CS, executing CS, or neither requesting nor executing CS (i.e.,
idle).

Walchand Institute of Technology, Solapur 7


Requirements of Mutual Exclusion Algorithm

1. Freedom from Deadlock


2. Freedom from Starvation
3. Fairness
4. Fault Tolerance

Walchand Institute of Technology, Solapur 8


How to Measure the Performance?
•The performance of mutual exclusion algorithms is generally measured by the
following four metrics:

i) The number of messages necessary per CS invocation.


ii) The synchronization delay.
iii) The response time.
iv) The system throughput

Walchand Institute of Technology, Solapur 9


1.Number of messages necessary per CS invocation

• The performance of a mutual exclusion algorithm is measured by the number


of messages exchanged per critical section execution and the delay between
successive executions of the critical section.

• There is a message complexity and synchronization delay trade-off in mutual


exclusion algorithms

Walchand Institute of Technology, Solapur 10


2. Synchronization Delay

Figure 1 : Synchronization Delay Source: [1]

Walchand Institute of Technology, Solapur 11


3.Response Time

Figure 2 : Response Time Source : [1]

Walchand Institute of Technology, Solapur 12


4. System Throughput

• It is the rate at which the system executes requests for the CS.

• If sd is the synchronization delay and E is the average critical section


execution time, then the throughput is given by the following equation:

system throughput = 1 /(sd + E)

Walchand Institute of Technology, Solapur 13


Think and Write
Q. Which of the following facility or capacity are required to provide support for the mutual
exclusion?
i) A process that halts in its noncritical section must do so without interfering with other
processes.
ii) The assumption should be made about relative process speeds or the number of processors.
iii) A process remains inside its critical section for a finite time only.

Options: a) i and ii only b) ii and iii only


c) i and iii only d) All i, ii and iii

Pause video and write down your answer

Walchand Institute of Technology, Solapur 14


Think and Write
Which of the following facility or capacity are required to provide support for the
mutual exclusion?
i) A process that halts in its noncritical section must do so without interfering with
other processes.
ii) The assumption should be made about relative process speeds or the number of
processors.
iii) A process remains inside its critical section for a finite time only.

Options: a) i and ii only, b) ii and iii only


c) i and iii only, d) All i, ii and iii

Answers is : c) i and iii only


Walchand Institute of Technology, Solapur 15
A Simple Solution to Distributed Mutual Exclusion
• In a simple solution to distributed mutual exclusion, a site, called the 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 method to achieve mutual exclusion in distributed systems requires only
three messages per CS execution.

Walchand Institute of Technology, Solapur 16


Thank you…

Walchand Institute of Technology, Solapur 18

You might also like