1
27kviews
What is the difference between deadlock prevention and avoidance algorithms?
1 Answer
written 8.6 years ago by |
Sr.no | Deadlock prevention | Deadlock Avoidance |
---|---|---|
1 | It is based on the fact that if any of the four necessary conditions is prevented, a deadlock will not occur. | It checks the state of the system, in advance and sees if the allocation of a resource will lead to a deadlock condition, if so it should wait. |
2 | It doesn’t need the knowledge of future process resource requests. | The avoidance method requires the knowledge of all future process resource requests |
3 | Advantage: It avoids the cost of detecting and resolving deadlocks because this method would make any of the four conditions false and avoid deadlock | Advantage: This method runs dynamically while allocating resource to a process and does not constrain the resources or processes with no system degradation or underutilization. |
4 | Disadvantage: It results in degraded system efficiency and low device utilization. | Disadvantage: It has certain restrictions like resource requirement of each process in advance, a fixed number of resources to allocate, no process should exit while holding resources. |
5 | Here we constrain resource requests to prevent at least one of the four conditions of deadlock. | It allows the four conditions but makes judicious decisions so that the deadlock point is not potentially reached. |
6 | Deadlock prevention techniques include non-blocking synchronization algorithms, serializing tokens, Dijkstras algorithm etc | For single instance of a resource type ,use,Resource Allocation Graph,For Multiple instance of a resource type, we use bankers algorithm |
7 | In some cases pre-emption happens more than often necessary | There is no pre-emption here. |