1,071 views
5 votes
5 votes
Q 1)  The query which is coming in my mind is which of the below techniques requires apriori information regarding the potential use , request of resources ?

a) Deadlock prevention

b) Deadlock avoidance

c) Deadlock detection

Q 2) Also what is the order of restrictiveness of the above techniques regarding the allocation of resources ?

Q 3) Is deadlock detection technique meant for before the deadlock has occured or after the deadlock has occured ?

1 Answer

Best answer
4 votes
4 votes

Deadlock Prevention: The goal is to ensure that at least one of the 4 necessary conditions for deadlock never hold. The system does not require additional apriori information regarding the overall potential use of each resource for each process. This is difficult to implement in practice.

Deadlock Avoidance: The goal is to plan very carefully so that the system will not enter an unsafe state. In order for the system to decide whether the next state will be safe or unsafe, it must know in advance, at any time the additional apriori information regarding the overall potential use of each resource for each process.

Deadlock Detection: The goal is to find a deadlock before or after it has happened. Detecting the possibility of a deadlock before it occurs is more difficult. The system does not requires additional apriori information regarding the overall potential use of each resource for each process in all cases.

Therefore, the answer to your first question is (b) Deadlock Avoidance.

Answer to the second question: For deadlock detection, the resource allocation strategy is very liberal. That means, resources are granted as and when requested. For deadlock prevention, the resource allocation is very strict or   rather conservative. It generally under utilizes the resources. The resource allocation strategy for deadlock avoidance is not that liberal, it checks whether a safe sequence exists before allocating (very similar to the process of a banker checking its financial position before passing a loan). At the same time, it is not that conservative as in deadlock prevention.

Answer to the third question is that Deadlock Detection can be used to detect a deadlock before or after it has happened.

I think this explanation clarifies all three questions.

selected by

Related questions

0 votes
0 votes
1 answer
1