Unit 4: Deadlock Management

By Haitomns G

4.1 Introduce Deadlock:

A Deadlock is a situation where each of the computer processes waits for a resource that is being assigned to another process. In this situation, none of the processes gets executed since the resource it needs, is held by some other process that is also waiting for some other resource to be released.

4.2 Describe necessary conditions for Deadlocks

  1. Mutual Exclusion
    A resource can only be shared in mutually exclusive manner. It implies, if two process cannot use the same resource at the same time.
  2. Hold and Wait
    A process waits for some resources while holding another resource at the same time.
  3. No preemption
    The process which once scheduled will be executed till the completion. No other process can be scheduled by the scheduler meanwhile.
  4. Circular Wait
    All the processes must be waiting for the resources in a cyclic manner so that the last process is waiting for the resource which is being held by the first process.

4.3 Explain methods for handling deadlock:

Deadlock Prevention

Deadlock happens only when Mutual Exclusion, hold and wait, No preemption, and circular wait holds simultaneously. If it is possible to violate one of the four conditions at any time then the deadlock can never occur in the system. The idea behind the approach is very simple we have to fail one of the four conditions but there can be a big argument on its physical implementation in the system.

Deadlock Ignorance

Deadlock Ignorance is the most widely used approach among all the mechanisms. This is being used by many operating systems mainly for end-user uses. In this approach, the Operating system assumes that deadlock never occurs. It simply ignores deadlock. This approach is best suitable for a single end-user system where the User uses the system only for browsing and all other normal stuff.

Deadlock Avoidance

In deadlock avoidance, the operating system checks whether the system is in a safe state or in an unsafe state at every step which the operating system performs. The process continues until the system is in a safe state. Once the system moves to an unsafe state, the OS has to backtrack one step. In simple words, The OS reviews each allocation so that the allocation doesn’t cause a deadlock in the system.

Deadlock detection and recovery

This approach lets the processes fall in deadlock and then periodically check whether deadlock occurs in the system or not. If it occurs then it applies some of the recovery methods to the system to get rid of deadlock.

Also Read

  1. How To Get A Domain Name For FREE in 2022
  2. How To Use Microsoft Office Apps For FREE (even offline)
  3. How To Read Wall Street Journal, NY Times, etc For FREE
  4. What Is A Podcast? How To Listen To It?
  5. How to use Spotify for FREE
  6. What Is GitHub Student Developer Pack And How To Get It For FREE?

Haitomns G. is a desktop, android, and web developer based in Nepal. He has worked on building several websites, apps, and softwares for clients and independent projects. He is experienced in C, C++, C#, Java, Python, SQL, HTML, CSS, PHP, and JavaScript.

6 thoughts on “Unit 4: Deadlock Management”

  1. Thanks a bunch for sharing this with all of us you actually know what you are talking about! Bookmarked. Please also visit my website =). We could have a link exchange arrangement between us!

    Reply
  2. Thank you for sharing excellent informations. Your website is so cool. I am impressed by the details that you?¬¶ve on this website. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found just the information I already searched everywhere and simply couldn’t come across. What a perfect web-site.

    Reply

Leave a Comment

Slide to prove you're not a bot/spammer *