What is the difference among deadlock avoidance, detection
and prevention?

Answers were Sorted based on User's Feedback



What is the difference among deadlock avoidance, detection and prevention?..

Answer / praveen

Deadlock Prevention:

Preventing deadlocks by constraining how requests for resources can be
made in the system and how they are handled (system design).
The goal is to ensure that at least one of the necessary conditions for
deadlock can never hold.
Deadlock Avoidance:

The system dynamically considers every request and decides whether it is
safe to grant it at this point,
The system requires additional apriori information regarding the overall
potential use of each resource for each process.
Allows more concurrency.
Similar to the difference between a traffic light
and a police officer directing traffic.

Is This Answer Correct ?    19 Yes 6 No

What is the difference among deadlock avoidance, detection and prevention?..

Answer / s_rock

Prevention:
• The goal is to ensure that at least one of the
necessary conditions for deadlock can never hold.

• Deadlock prevention is often impossible to
implement.
• The system doesnot require additional apriori
information regarding the overall potential use of each
resource for each process.
• In order for the system to prevent the deadlock
condition it does not need to know all the details of all
resources in existence, available and requested.
• Deadlock prevention techniques include non-blocking
synchronization algorithms, serializing tokens, Dijkstras
algorithm etc.
• Resource allocation strategy for deadlock
prevention is conservative, it under commits the resources.
• All resources are requested at once.
• In some cases preempts more than often necessary.
Avoidance:
• The goal for deadlock avoidance is to the system
must not enter an unsafe state.
• Deadlock avoidance is often impossible to
implement.
• The system requires additional apriori information
regarding the overall potential use of each resource for
each process.
• In order for the system to be able to figure out
whether the next state will be safe or unsafe, it must know
in advance at any time the number and type of all resources
in existence, available, and requested.
• Deadlock avoidance techniques include Banker’s
algorithm, Wait/Die, Wound/Wait etc.
• Resource allocation strategy for deadlock avoidance
selects midway between that of detection and prevention.
• Needs to be manipulated until atleast one safe path
is found.
• There is no preemption.
Detection:
• The goal is to detect the deadlock after it occurs
or before it occurs.
• Detecting the possibility of a deadlock before it
occurs is much more difficult and is, in fact, generally
undecidable. However, in specific environments, using
specific means of locking resources, deadlock detection may
be decidable.
• The system doesnot requires additional apriori
information regarding the overall potential use of each
resource for each process in all cases.
• In order for the system to detect the deadlock
condition it does not need to know all the details of all
resources in existence, available and requested.
• A deadlock detection technique includes, but is not
limited to, Model checking. This approach constructs a
Finite State-model on which it performs a progress analysis
and finds all possible terminal sets in the model.
• Resource allocation strategy for deadlock detection
is very liberal. Resources are granted as requested.
• Needs to be invoked periodically to test for
deadlock.
• Preemption is seen.

Is This Answer Correct ?    10 Yes 2 No

What is the difference among deadlock avoidance, detection and prevention?..

Answer / avinash raipuria

*
Deadlock Prevention:
o Preventing deadlocks by constraining how
requests for resources can be made in the system and how
they are handled (system design).
o The goal is to ensure that at least one of the
necessary conditions for deadlock can never hold.

*
Deadlock Avoidance:
o The system dynamically considers every request
and decides whether it is safe to grant it at this point,
o The system requires additional apriori
information regarding the overall potential use of each
resource for each process.
o Allows more concurrency.

Similar to the difference between a traffic light

and a police officer directing traffic.





* Deadlock deduction:-
Often, neither avoidance nor deadlock
prevention may be used. Instead deadlock detection and
process restart are used by employing an algorithm that
tracks resource allocation and process states, and rolls
back and restarts one or more of the processes in order to
remove the deadlock. Detecting a deadlock that has already
occurred is easily possible since the resources that each
process has locked and/or currently requested are known to
the resource scheduler or OS.

Detecting the possibility of a deadlock before it occurs is
much more difficult and is, in fact, generally undecidable,
because the halting problem can be rephrased as a deadlock
scenario. However, in specific environments, using specific
means of locking resources, deadlock detection may be
decidable. In the general case, it is not possible to
distinguish between algorithms that are merely waiting for a
very unlikely set of circumstances to occur and algorithms
that will never finish because of deadlock.

Deadlock detection techniques include, but is not limited
to, Model checking. This approach constructs a Finite
State-model on which it performs a progress analysis and
finds all possible terminal sets in the model. These then
each represent a deadlock.

Is This Answer Correct ?    8 Yes 1 No

Post New Answer

More SDK Interview Questions

what basically a system call is?

3 Answers   Infosys,


in a time-sharing operating system, when the time slot given to a process is completed,the process goes from the Running state to the: a) BLOCKED state b) Ready state c) SUSPENDED state d) Terminated state

3 Answers   Public Service Commission,


can you create con folder in windows, if not why?

3 Answers  


What is Awk and Sed?

1 Answers  


Explain about busy waiting?

0 Answers  






What is direct mount and indirect monut?

0 Answers  


What is the difference among deadlock avoidance, detection and prevention?

3 Answers  


what are the stands for OAB(offline address book) in exchange server?

1 Answers   DELL, Microsoft,


Tell me what are the hardware problem you face regularly in your organization?

0 Answers  


What is the difference between NTFS & FAT File systems

6 Answers   CA,


Can you tell which dlls are used for SDK?

0 Answers   C DAC, CDAC,


Explain the ways to infect the system by virus?

0 Answers  


Categories