Term Paper
Term Paper
Authors:
Romi kumari Md Ali Azam Shivam Raj Singh
1.ABSTRACT
Deadlock is a hypercritical problem in modern systems where the
process stops while it is waiting for resources which are held by some
another. In this study, we are going to examine how deadlock occurs.
How it can be detected, avoided, prevention, characterization of
deadlock. We will be demonstrating the graphs for the representation
of deadlock. We will also highlight what are their strengths and what
are their limitations. Using case studies, we will try to illustrate how
the deadlocks are arisen in the practical situations. Our main goal is to
emphasize of headlock mechanisms and create a more efficient
modern system environment that will be beneficial for us and other
users.
2. INTRODUCTION
3. LITERATURE REVIEW
Till now, we have understood what is deadlock. Now we will see how
a deadlock is represented.
Deadlock is represented by directed graphs, commonly known as
“Resource Allocation Graph”.
These are set of vertices V and a set of edges E, where V is
partitioned into two types -
1. P - {P1, P2, …, Pn} the set contains all active processes.
2. R - {R1, R2, …, Rn} the set contains all resource types.
The set of edges are also defined into two types –
1. Request edge - Directed edge P->R. Process P requests for
instance of resource R. (Outside the process)
2. Assignment edge – Directed edge R->P. Resource R is
allocated to process P. (Inside the process)
Representation:
1. Process represented by a circle.
-----------------
-----------
4. MANAGING DEADLOCK
we will now see what are the methods for handling the
deadlocks. How we can deal with them.
So, there are four methods, through which we can handle the
deadlocks:
1. Prevention
2. Avoidance
3. Detection
4. Do nothing.
DEADLOCK PREVENTION
5.DEADLOCK AVOIDANCE
BANKER’S ALGORITHM
But this will work only if the instance given for each resource is
static, but in real-world scenario this doesn’t work. Here resources are
instantiated directly on run – time, that means dynamically. So, it can
be used in statically only and only in theory. However, we can create
a program but this doesn’t work in real-world scenario.
6.DEADLOCK DETECTION
For the detection of deadlock, the system must be providing some
conditions such as any algorithm to recovering from the deadlock. An
algorithm that examines the current state of system to check whether a
deadlock has occurred or not. It works by regularly checking the state
of the processes.
If the detection algorithms are invoked randomly then it is hard to tell
that deadlock is occurred by which process. But when the detection
algorithms is invoked for every resource request then a overhead will
occur in computation time
We can use an alternate to invoke the algorithm when CPU utilization
drops below 40%.
It improves the stability of the system because it is a main concern in
the operating system. Also, these are easily implemented and can be
used on a large range of and also with the system with different
resource allocation and synchronization requirements.
It has some disadvantages also. It can introduce performance
overhead, because the system regularly checks for deadlocks and it
should take appropriate action. Some algorithms are complex to
implement and requires good understanding of the system and its
working. Deadlock detection algorithms are not perfect sometimes as
it can create illusion.
Sometimes they fail to indicate the presence of deadlock whether they
exist or not. It totally depends on some particular requirements of the
system. Lastly, these detections are important for identifying the
situations whether the processes get stuck waiting for any resource.
The wait-for graph scheme is not applicable to a resource-allocation
system with multiple instances of each resource type. The graph is
obtained by removing the resource nodes from a resource-allocation
graph and collapsing the appropriate edges
Wait-for graph is used to detect the deadlock.
9.CONCLUSION
A deadlock state occurs when two or more processes are waiting for
some particular resources. We have to use some protocol, algorithms,
methods to prevent or avoid it, or we can do one more thing first put
the system in deadlock and then detect it, and then only try to recover
from that.
Also, we can ignore the problem and simultaneously, and then we can
pretend like nothing happened. And as usual we can work with our
computer ignoring that deadlock. This is used by the most operating
system, including Linux and Windows.
A method for avoid deadlocks, rather than prevention from them,
requires that the operating system have a priority information about
how each process will utilize system resources.
Deadlock can occur in four conditions – mutual exclusion, hold-and-
wait, no-preemption and circular wait. One of these conditions must
be fulfilled. As we have discussed earlier.
Many researchers have argued that these basic approaches are not
sufficient is we are using it alone. We have to use these approaches in
combination but we can choose an optimal approach to solve this.
REFERENCES:
Press, London, UK