How can a Deadlock Situation be avoided?

Please provide the method of avoiding a Deadlock Situation?

Add a comment


8 replies


"Deadlock Avoidance : Avoiding Deadlocks is to require additional information about how resources are to be requested. A Deadlock-Avoidance algorithm dynamically examines the resource-allocation state to ensure that there can never be a circular wait condition. The resource allocation state is defined by the number of available and allocated resources, and the maximum demands of the processes. There are various methods used for the purpose of Deadlock Avoidance : (1) Safe State : A state is safe if the System can allocate resources to each process (up to its maximum) in some order and still avoid a Deadlock. More formally, a System is in a safe state only if there exists a safe sequence. If no such sequence exists, then the System state is said to be unsafe. (2) Resource-Allocation Graph Algorithm : Suppose that process Pi requests resource Rj. The request can be granted only if converting the request edge Pi Rj to an assignment edge Rj Pi does not result in the formation of a cycle in the Resource- Allocation Graph. (3) Banker's Algorithm : This Resource-Allocation Graph Algorithm is applicable to a Resource-Allocation System with multiple instances of each resource type. This algorithm is commonly known as the Banker's Algorithm. Source:"

Add a comment


"To aid decrease deadlocks: Access items inside the similar buy. Stay clear of consumer fundamental interaction inside orders. Retain deals short plus just one batch. Use a lower seclusion amount. Work with a row versioning-primarily based isolation levels. Fixed READ_COMMITTED_Snap repository choice Onto enable read-determined dealings to use rowing versioning. Make use of bio remoteness. Use certain internet connections"

Add a comment