In these slides I discussed about deadlock,causes of deadlock,effects of deadlock,conditions of deadlock,resource allocation graph,deadlock handling strategies,deadlock prevention,deadlock avoidance,deadlock avoidance and resolution....I haven't touch algorithms section in these slides.....and last thing I want to say that don't forget to follow me...
4. contents
• What is dead lock?
• What is causes and effect of dead lock?
• Conditions of dead lock
• Dead lock handling strategies
5. What is dead lock?
• A deadlock is a situation in which two
computer programs sharing the same
resource are effectively preventing
each other from accessing the
resource, resulting in both programs
ceasing to function.
12. Hold and wait
P1 hold one resource and wait for 2nd.
P2 hold 2nd resource and wait for 1st.
13. No - Preemption
A resource can be released only
voluntarily by the process
holding it, after that process
has completed its task.
14. Circular wait
There exists a set {P0, P1, …, P0} of waiting
processes such that P0 is waiting for a resource
that is held by P1, P1 is waiting for a resource
that is held by P2, …, Pn–1 is waiting for a
resource that is held by Pn, and P0 is waiting for
a resource that is held by P0.
15. A set of vertices V and a set of edges E.
■ V is partitioned into two types:
● P = {P1, P2, …, Pn}, the set consisting of all the
processes in the system.
● R = {R1, R2, …, Rm}, the set consisting of all
resource types in the system.
Resource Allocation Graph
19. Methods for Handling Deadlocks
■ Ensure that the system will never enter a deadlock
state.
■ Allow the system to enter a deadlock state and
then recover.
■ Ignore the problem and pretend that deadlocks
never occur in the system; used by most operating
systems, including UNIX.
20. Deadlock Prevention
Restrain the ways request can be made:
■ Mutual Exclusion – not required for sharable resources;
must hold for non-sharable resources.
21. ■ Hold and Wait – must guarantee that whenever a process
requests a resource, it does not hold any other resources.
● Require process to request and be allocated all its
resources before it begins execution, or allow process to request
resources only when the process has none.
● Low resource utilization; starvation possible.
22. Recovery from Deadlock:
■ Abort all deadlocked processes.
■ Abort one process at a time until the deadlock cycle is
eliminated.
23. ■ In which order should we choose to abort?
● Priority of the process.
● How long process has computed, and how much longer to
completion.
● Resources the process has used.
● Resources process needs to complete.
● How many processes will need to be terminated.
● Is process interactive or batch?
24. Deadlock Avoidance
Requires that the system has some additional a priori
information available.
■ Simplest and most useful model requires that each process
declare the maximum number of resources of each type that it
may need.
25. ■ The deadlock-avoidance algorithm dynamically
examines the resource-allocation state to ensure that there
can never be a circular-wait condition.
■ Resource-allocation state is defined by the number of
available and allocated resources, and the maximum
demands of the processes.
26. Deadlock Detection and
Resolution:
It analyses the resource state to check that
deadlock exist or not. If so abort some process
And allocates the resources to other processes.