• About WordPress
    • WordPress.org
    • Documentation
    • Support
    • Feedback
  • Log In
  • Register
  • Home
  • Courses
  • Past Paper
  • FYP
  • Interview Questions
  • University Events
  • Contact
  • Quiz & Assignment
Cuitutorial
  • Home
  • Courses
  • Past Paper
  • FYP
  • Interview Questions
  • University Events
  • Contact
  • Quiz & Assignment

Operating System

Home » Blog » Dead Lock in operating system

Dead Lock in operating system

  • Posted by saqib
  • Categories Operating System
  • Date January 3, 2023
  • Comments 0 comment

Dead Lock in operating system

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

Let us assume that there are three processes P1, P2 and P3. There are three different resources R1, R2 and R3. R1 is assigned to P1, R2 is assigned to P2 and R3 is assigned to P3.

After some time, P1 demands for R1 which is being used by P2. P1 halts its execution since it can’t complete without R2. P2 also demands for R3 which is being used by P3. P2 also stops its execution because it can’t continue without R3. P3 also demands for R1 which is being used by P1 therefore P3 also stops its execution.

In this scenario, a cycle is being formed among the three processes. None of the process is progressing and they are all waiting. The computer becomes unresponsive since all the processes got blocked.  

  • Circular Wait:-When two or More Requests are Waiting For a Long Period of Time and no one can Access the Resource  from the System Resources , Then this is called as Circular Wait For Example if two or more users Request for a Printer, at a Same Time , they Request to Print a Page. Then they will be on the Circular Wait. Means System Will Display Busy Sign of Sign.
  • Partial Allocation: –After Processing the Request, if a user doesn’t leave the Resource of the System, then we cant use the Resource of the System. Then in this Situation when the other users, Request for the Resource then the other users, will also be on the Waiting State. Then this will create the Deadlock.
  • Mutual Exclusive:-When a Single Process is used by two or more Processes, Means a Single Resource if used for performing the two or more activities as a Shared Based. But this is will Also Create a Problem because when a Second user Request for the System Resource which is being used by the user.
  • HOLD and Wait:-A Single Process may need two or more System Resources. And suppose if a Process have a Single Resource, and he is waiting the Second Resource. Then Process can’t Leave the first Resource and waiting for the Second Resource. So that there will also be the Condition of Deadlock.
  • No Preemption:-if there is no Rule to use the System Resources. Means if all the System Resources are not allocated in the Manner of Scheduling. Then this will also create a Problem for a Deadlock because there is no surety that a Process will Release the System Resources after the Completion. So Preemption and Transaction Rollback prevents Deadlock situation.

For Avoiding a Dead Lock First of all we have to detect Dead-Lock Means Firstly we have to detect why and how a Deadlock has occurred and Then Avoid or Solve the Problems those are Occurred  due to Occurrence of Deadlock.

  • Share:
author avatar
saqib

Previous post

Round Robin Scheduling Algorithm in Operating system
January 3, 2023

Next post

Beautiful UI design in flutter
January 5, 2023

You may also like

Aging in operating system
6 January, 2023

Aging in operating system In Operating systems, Aging is a scheduling technique used to avoid Starvation. Fixed priority scheduling is a scheduling discipline in which tasks queued for utilizing a system resource is assigned each priority. A task with a …

Starvation in operating system
6 January, 2023

Starvation in operating system It is a problem when the low-priority process gets jammed for a long duration of time because of high-priority requests being executed. A stream of high-priority requests stops the low-priority process from obtaining the processor or …

Round Robin Scheduling Algorithm in Operating system
2 January, 2023

Round Robin Scheduling algorithm with Example The round-robin scheduling takes its name from the round-robin scheduling idea. This principle states that everyone will divide anything they possess equally among themselves. Round Robin scheduling algorithm is used in a time-sharing system. …

Leave A Reply Cancel reply

You must be logged in to post a comment.

admin@cuitutorial.com
Facebook-f Twitter Youtube Linkedin Instagram Stack-overflow Pinterest Github Quora Whatsapp
Courses
  • All Courses
  • Past Paper
  • Final year projects
  • Interview Questions
  • Contact
Important Pages
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
Links
  • University Events
  • Team
Education & learning platform for All Computer science subjects
Final year projects
Past Paper
Interview questions
Programming, C/C++, Asp.net/MVC. Android, MySql, Jquery, Ajax, javascript, Php, Html5, Bootstrap4.
NTS, GAT, PPSC, FPSC

Copyright © 2021 | Cuitutorial