Deadlock prevention in Operating system is more preventive and conservative.
We take care of eliminating any of deadlock causing condition:
1. Circluar wait:
Processes form cycle of waiting relationship.
2. Hold and wait:
Processes hold up resources which they have and w8 on resources they want.
3. No Preemption:
Once, a processes is in execution it is not preempted.
4. Mutual Exclusion:
When a process is executing on a variable no other process can access that variable.
Now for deadlock prevention what we do is don’t let our system to do anyone of this.
You may like to read : NP Problem Stepwise
In this we look every single resource request and decide whether to allow that request.
Now take an example of protection from viral through water
In scenario like deadlock prevention, we would not let one to drink water.
In scenario of deadlock avoidance we would first filter out water
So in clear cut words deadlock prevention is more preventive and conservative. Conservative in the way that, it would decrease the power of the system by not allowing mutual exclusion., etc
Incoming search terms:
- difference between deadlock prevention and deadlock avoidance
- deadlock prevention and avoidance
- deadlock prevention vs avoidance
- difference between deadlock prevention and avoidance
- difference between deadlock avoidance and prevention
- deadlock avoidance and prevention
- deadlock prevention vs deadlock avoidance
- deadlock avaidance from deadvlockbprevention
- compare and contrast deadlock prevention and deadlock avoidance