Header Ads Widget

Deadlock Prevention

It's important to prevent a deadlock before it can occur. The system checks every transaction before it is executed to make sure it doesn't lead the deadlock situations. Such that even a small change to occur dead that an operation which can lead to Deadlock in the future it also never allowed process to execute.

It is a set of methods for ensuring that at least one of the conditions cannot hold.

No preemptive action:

No Preemption - A resource can be released only voluntarily by the process holding it after that process has finished its task

  • If a process which is holding some resources request another resource that can't be immediately allocated to it, in that situation, all resources will be released.
  • Preempted resources require the list of resources for a process that is waiting.
  • The process will be restarted only if it can regain its old resource and a new one that it is requesting.
  • If the process is requesting some other resource, when it is available, then it was given to the requesting process.
  • If it is held by another process that is waiting for another resource, we release it and give it to the requesting process.

Mutual Exclusion:

Mutual Exclusion is a full form of Mutex. It is a special type of binary semaphore which used for controlling access to the shared resource. It includes a priority inheritance mechanism to avoid extended priority inversion problems. It allows current higher priority tasks to be kept in the blocked state for the shortest time possible.

Resources shared such as read-only files never lead to deadlocks, but resources, like printers and tape drives, needs exclusive access by a single process.

Hold and Wait:

In this condition, processes must be stopped from holding single or multiple resources while simultaneously waiting for one or more others.

Circular Wait:

It imposes a total ordering of all resource types. Circular wait also requires that every process request resources in increasing order of enumeration.

Post a Comment

0 Comments