Home Technical Stuff Deadlock Prevention Vs Deadlock Avoidance in Operating system

Deadlock Prevention Vs Deadlock Avoidance in Operating system

3 min read

The operating system is nothing but the system program which loads into the memory first and then provides the environment for other users program to run their own program. The operating system is not only mean to be for Computer nowadays. It is also widely getting used in mobile. In an earlier post, we have shared different types of OS used in smart phone. In this post, we talk about the deadlock in the operating system.

 

Deadlock prevention Vs Deadlock Avoidance Deadlock prevention  in Operating system is more preventive and conservative.

 

If you are not familiar with deadlock in computer science, you must see the post Deadlock in Operating System: Things that You Must Know about It.

 

Deadlock Prevention:

We take care of eliminating any of deadlock causing condition:

  • 1. Circular wait:
    Processes form the 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 process 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

 

Deadlock Avoidance:

In this, we look every single resource request and decide whether to allow that request to process. The action will be taken before occurring deadlock.

 

Deadlock can be avoided by Bankers Algorithm. It is resource allocation algorithm developed and designed by Edsger Dijkstra.

 

Difference Deadlock Prevention Vs Deadlock Avoidance:

Many get confused over Deadlock prevention Vs Deadlock Avoidance  in Operating system.

Let’s try to understand it by considering the analogy. It will be easy.

Now take an example of protection from viral through the water. In the scenario like deadlock prevention, we would not let one to drink water. In the 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

Comments

comments

Load More Related Articles
Load More By Madhav Purohit
Load More In Technical Stuff

4 Comments

  1. Derwick

    2014/12/01 at 5:55 am

    You really make it appear so easy along wit your presentation but I
    to find this matter to be really one thing which I feel I’d
    by no means understand. It kind of feels too complicated and vvery large
    for me. I am taiing a look ahead for your subsequent
    post, I’ll try to get the hold of it!

  2. Madhav Purohit

    2014/12/01 at 12:55 pm

    @Derwick: I am happy that this article is being useful to someone. Thanks for your feedback

  3. Mit Joshi

    2014/12/01 at 4:55 pm

    Very nice article, exactly what I was looking for.

  4. Ram M.

    2014/29/01 at 3:55 am

    Keep on working, great job!

Check Also

5 Tech Habits | How does Technology Affect Us Negatively?

How does technology affect us negatively? These tech habits help to have a safe and seamle…