Unit-2 (A)
Unit-2 (A)
OPERATING SYSTEMS
MCS-041
Block-3
Unit-2(a)
Topics to be covered
Distributed Systems
Implementation of RPC
Limitations
nodes
Key Features of Distributed Systems
implemented in software
processing)
• Communication.
• Latency: Delay that occurs after a send operation is executed before data starts to
• Data Transfer Rate: Speed at which data can be transferred between two computers
• Total network bandwidth: Total volume of traffic that can be transferred across the
• Higher security risk due to more possible access points for intruders and possible
Design Goals
a) Naming
b) Communication
c) Software Structure
d) Workload Allocation
e) Consistency Maintenance
Naming
• A name is a string of characters used to identify and locate a distributed resource.
• An identifier is a special kind of name that is used directly by the computer to access
the resource.
For example the identifier for a Unix server would include at least (1) an IP address
and (2) a port number. The IP address is used to find the node that runs the server
and the port number identifies the server process on that node.
distributed service).
Communication & Software
Structures
Communication
• Messages
Software Structures
• The main issues are to choose a software structure that supports our goals,
• We thus want structures that promote extensibility and otherwise make it easy to
• The key issue is load balancing: The allocation of the network workload such that
network resources (e.g., CPUs, memory, and disks) are used efficiently.
a) Processor Pools
b) Idle Workstations
Consistency Maintenance
The final issue is consistency. There are four key aspects of consistency:
Atomicity
Coherence
Failure Consistency
Clock Consistency
Distributed System Structure
There are three main alternative ways to structure a distributed application. The
• Distributed objects
Nodes that import and use the service are called “clients”.
Language-level objects (e.g., C++, Java, Smalltalk) are used to encapsulate data
Clients communicate with servers through objects that they “share” with the server.
objects hide even more of the details of distribution than RPC (more next week)
Objects allow clients and servers to communicate using in two different ways:
When all processes sharing a resource are on the same machine, mutual
typically becomes acute with graphics printers. In such a context, it is desirable to block
an applications process until the printer is ready to accept data from that applications
process, and then let that process directly deliver data to the printer. For example, an
If all users of the spooler use this protocol, the spooler is no longer serving as a spooler,
it is merely serving as a mutual exclusion mechanism
Token Based Mutual Exclusion
One alternative to the mutual-exclusion server is to arrange the competing processes in
a ring and let them exchange a token. If a process receives the token and does not need
exclusive use of the resource, it must pass the token on to the next process in the ring. If
a process needs exclusive use of the resource, it waits for the token and then holds it
until it is done with the resource, at which point it puts the token back in circulation.
This is the exact software analog of a token ring network. In a token ring network, only
one process at a time may transmit, and the circulating token is used to assure this.
Token Based Mutual Exclusion
• Token-based solution: processes share a special message known as a
token
– If a process receives the token and doesn’t need it, just pass it on.
Token Based Mutual Exclusion
• Advantages:
According to the analogy, the "customers" are threads, identified by the letter i, obtained from a
global variable. Due to the limitations of computer architecture, some parts of
Lamport's analogy need slight modification. It is possible that more than one thread will get the
same number when they request it; this cannot be avoided. Therefore, it is assumed that the
thread identifier i is also a priority. A lower value of i means a higher priority and threads with
higher priority will enter the critical section first.
Lamport's Bakery Algorithm
Lamport’s Bakery Algorithm provides a decentralised implementation of the “take a
number” idea. As originally formulated, this requires that each competing process
share access to an array, but later distributed algorithms have eliminated this shared
data structure. Here is the original formulation:
For each process, i, there are two values, C[i] and N[i], giving the status of process I
and the number it has picked. In more detail:
Ricart and Agrawala's Mutual
Exclusion Algorithm
Ricart and Agrawala's Mutual
Exclusion Algorithm
Ricart and Agrawala's Mutual
Exclusion Algorithm
Ricart and Agrawala's Mutual
Exclusion Algorithm
To be Continue in next session….