Deadlock Prevention
Deadlock Prevention
• Ensure that resources that can't be shared are only assigned to one
process at a time.(condition must hold for non-sharable resource)
• mutual exclusion means that multiple processes can't use the same
resource at the same time.
• This strategy involves ensuring that resources, such as files, devices,
or data structures, can only be accessed by one process at a time
•
Hold and Wait:
• A process waits for same resource while welding another resource at the same
time
• Hold and wait condition occurs when a process holds a resource and is also
waiting for some other resource in order to complete its execution. Thus, if
we did not want the occurrence of this condition then we must guarantee
that when a process requests a resource, it does not hold any other resource
•
No Preemption
• The process which once scheduling will be executed till the completion
• This means that once a process has been allocated resources, it keeps them until it
allocated to another process, the requesting process must wait until the
• All the processes must be waiting for the resource in a cyclic manner
• consider three processes, P1, P2, and P3, each holding a different
resource R1, R2, and R3, respectively, and waiting for a resource
held by a process with lower priority. If P1 has the highest priority,
P2 has medium priority, and P3 has the lowest priority, the system
can allocate resources in such a way that P3 must release its resource
before P2 can acquire it, and P2 must release its resource before P1
can acquire it.