1 - 31 - July
1 - 31 - July
Deadlock
Deadlock Demonstrated
What is a deadlock?
Deadlocks are a set of blocked processes each holding a resource
and waiting to acquire a resource held by another process.
Deadlock is a common problem in multi-processing where several
processes share a specific type of mutually exclusive resource
known as a soft lock or software.
Deadlock vs Starvation
Deadlock Starvation
Deadlock is a situation where Starvation is a situation where
no process got blocked and no the low priority process got
process proceeds blocked and the high priority
processes proceed.
Deadlock is an infinite waiting. Starvation is a long waiting
but not infinite.
Every Deadlock is always a Every starvation need not be
starvation. deadlock.
Avoidance
Detection
Ignorance
.
System Model
. System consists of resources
Resource types R1, R2, . . ., Rm
CPU cycles, memory space, I/O devices
Each resource type Ri has Wi instances.
Each process utilizes a resource as follows:
request
use
release
Resource-Allocation Graph
.A set of vertices V and a set of edges E
R = {R1, R2, …, Rm}, the set consisting of all resource types in the system
Pi requests instance of Rj Pi
Pi is holding an instance of Rj Pi
Resource-Allocation Graph
.
Fig 1: RAG fig2 : RAG with Deadlock Fig 3: RAG without Deadlock
Conclusion
If graph contains no cycles no deadlock
If graph contains a cycle
◦ if only one instance per resource type, then deadlock
◦ if several instances per resource type, possibility of
deadlock
References
1. Silberschatz, Galvin, Gagne, Operating System Concepts: International Student
Version, 9th Edition, Paperback: 992 pages Publisher: Wiley; Eighth edition (20
April 2009) Paperback – 20 Apr 2009, Language: English, ISBN-10: 8126520515,
ISBN-13: 978-8126520510.