Professional Documents
Culture Documents
Module 05
Module 05
• Conventional OS deals with the mechanism and policies for sharing the processor
of the system among all processes.
• Distributed Operating System To make best possible use of the processing
resources of the entire system by sharing them among all processes.
• Three concepts to achieve this goal:
• Processor allocation: Deals with the process of deciding which
process should be assigned to which processor.
• Process migration: Deals with the movement of a process from its current
location to the processor to which it has been assigned.
• Threads: Deals with fine-grained parallelism for better utilization of the
processing capability of the system.
Process Migration
• Issues:
1. Immediate and delayed blocking of the process
2. Fast and slow I/O operations
3. Information about open files
4. Reinstating the process on its destination node
Reinstating the process on its Destination node:
• The migration of a process involves the transfer of following information from the
source node to the destination node.
• Process’s state (Computation state, Communication state)
• Process’s address space (Code, data, program stack)
• Possible to transfer the address space without stopping its execution.
• Not possible to resume execution until the state information is fully transferred.
• Three methods for address space transfer
1. Total freezing
2. Pre-transferring
3. Transfer on reference
Total Freezing
Source node destination node
Execution is stopped
Time
while its address Execution
is suspended Migration
decision
space being
transferred made
Process is suspended
for a long Transfer of
address
time during Freezing
Time
space
Execution
migration resumed
Disadvantage:
The message forwarding mechanism of process migration operation is non-
transparent to the process interacting with the migrant process.
Origin site Mechanism
• Each site is responsible for keeping information about the current location of all
the processes created on it.
• Messages for a particular process are always first sent to its original site.
• The origin site then forwards the message to the process’s current location.
Disadvantage:
• Failure of the origin site will disrupt the message forwarding mechanism.
Link Traversal Mechanism
• To redirect message, a message queue for the migrant process is created on its
source node.
• A forwarding address known as link is left at the source node pointing to the
destination of the migrant process.
• Components of link: unique process identifier, last known location.
Disadvantage:
Several link may have to be traversed to locate a process from a node and if any
node in chain of link fails, the process cannot be located.
Link update Mechanisms
Mechanism:
• Disallowing separation of coprocesses.
• Home node or original site concept.
Disallowing Separation of coprocesses
• Easiest method of handling communication between coprocesses is to disallow
their separation.
Methods:
• By Disallowing the migration of processes that wait for one or more of their
children to complete.
• By ensuring that when a parent process migrates, its children process will be
migrated along with it.
• Disadvantage: It does not allow the use of parallelism within jobs.
Home node or Origin Sites Concept
• Used for communication between a process and its sub process when the two are
running on different nodes.
• Allows the complete freedom of migrating a process or its sub process
independently and executing them on different nodes of the system.
• Load estimation policies try only to check if a node is idle or busy, e.g. via measuring CPU
utilization.
• Process transfer policies May use single or double threshold policies i.e. in single, a node
already executing one process may transfer others. In double however, anticipation is a
factor i.e. nodes about to be underutilized are given more processes.
• Location Policies which may take the forms of:-
• Sender-initiated policy - in which sender node decides where to send process.
• Receiver-initiated policy - in which receiver node decides from where to get the
process.
• State information exchange policies A node normally exchanges state info only when its
state changes that takes either of the forms below.
• Broadcast when state changes.
• Poll when state changes.
DEADLOCK
• A deadlock occurs when a set of processes requests resources that are
already occupied by other processes in the group.
• Because each process possesses a resource and waits for another resource
held by another process, the execution of two or more processes is blocked.
Four requirements must be met for a deadlock to occur :
• Mutual Exclusion
At least one resource in the system must be able to be used by only one process at
a time.
• Hold & Wait
There must be a process that retains a resource while waiting for another resource
acquired by some other process.
• No Preemption
It means that resources cannot be taken forcefully from one process and handed
over to another.
• Circular Wait
All processes must wait for the resource in a cyclic fashion, with the last process
waiting for the first process’s resource.
Distributed system deadlocks
• A Distributed system is a Network of Machines that can exchange information with each other
through Message-passing.
• Helps in resource sharing.
• If the sequence of resource allocation to processes is not controlled, a deadlock may occur.
• COMMON METHODS TO HANDLE DEADLOCK:
Ignore
Detection
Prevent
Avoid
• Types of Distributed Deadlock:
Resource Deadlock
Communication Deadlock
Resource Deadlock
• A resource deadlock occurs when two or more processes wait permanently for
resources held by each other.
• A process that requires certain resources for its execution, and cannot proceed
until it has acquired all those resources.
In the communication model, a process cannot In the resource allocation model, a process cannot
2. proceed with the execution until it can communicate proceed with the execution until it receives all the
with one of the processes for which it is waiting. resources for which it is waiting.
3. Waiting (by processes) is done for messages. Waiting (by processes) is done for resources.
If each process in the set is waiting to communicate If each process in the set seeks resources held by
with another process in the set, and no process in another process in the set, and it must obtain all the
4. the set ever begins any additional communication requested resources before it can become
until it receives the communication for which it is unblocked, the process set is resource-deadlocked.
waiting, the set is communication-Deadlocked.