A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Deadlock Management Strategies – Deadlock Avoidance

Deadlock Avoidance is another approach towards the elimination of the deadlock problems.
– Deadlocks are also quite common as in the case of the distributed systems (in this case called the distributed deadlocks).
– Deadlock avoidance is a type of deadlock management strategy that involves anticipation of the deadlock before its actual occurrence.
– This deadlock management strategy is actually based up on an algorithm that helps in accessing the possibility of the occurrence of the deadlock and action to be taken accordingly.
– You may feel that this strategy is somewhat similar to deadlock prevention but this is not so.
– Deadlock prevention strategies make sure that there is no possibility of occurrence of a deadlock by denying any one of the 4 Coffman conditions.
– Deadlock avoidance comes in to place when it is very difficult to deny any one of the 4 conditions.
– This is done by being careful during the allocation of the resources.

Banker’s Algorithm

– For this, an algorithm such as the banker’s algorithm is absolutely necessary.
– This algorithm was marked as the best one for the deadlock avoidance by Dijkstra in the year of 1965.
– The process got its name because of sharing analogy with the algorithm used by a banker for determining whether it is safe to give a loan or not.
– In this analogy the processes are equivalent to customers, resources can be compared to units and the operating system is our banker.

Safe state: The key to maintain a safe state is finding at least one way in which all the users can finish.
Unsafe state: If all the processes or the threads requested for the maximum amount of resources, then any one of these also cannot be satisfied by the operating system and this would lead to a deadlock.

– However, it is not necessary that an unsafe state necessarily means that the existence of the deadlock is sure.
– The notion of an unsafe state simply implies that some wrong sequence of the events can cause a deadlock to occur.
– The banker’s algorithm thus need to consider each of the request whenever it occurs and decide if granting the request will maintain the safe state or not.
– If it is safe, then only the request is granted otherwise it is granted later.
– It was shown by Haberman in the year of 1969 that the complexity of the execution of this algorithm is proportional to the square of the number of the processes.
– This is why a significant overhead is generated every time this algorithm executed.
– Deadlocks can be avoided if certain information is made available in advance.
– In safe state, the order of scheduling is as such that the all the process can achieve completion even if they all request for the resources at the same time.
– On the other hand in unsafe state there is no such scheduling order.
– This order is subject to work properly if the resources are released by the process at the right time.

– Suppose there is only one resource to be dealt with and every process has a maximum possible resource allocation limit.
– Only a certain amount of resource is available with the operating system to allocate.
– Not all the processes require the resource at the same time.
– The solution for this situation is to grant the request if the process would leave the system in a safe state.
– At the start up itself, the resource requirements must be stated by the process.
– But this is not 100 percent possible.
– Process are born and die every moment.
– Resources start to vanish with the breaking of the hardware.
– The file name binding in old mainframes was done just before the execution thus making it easy to move the files.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>