Deadlock and Starvation - Operating Systems - Lecture Slides, Slides for Computer Science. All India Institute of Medical Sciences
ekana
ekana27 March 2013

Deadlock and Starvation - Operating Systems - Lecture Slides, Slides for Computer Science. All India Institute of Medical Sciences

PDF (674 KB)
12 pages
1000+Number of visits
Description
These are the Lecture Slides of Operating Systems which includes Sleeping Barber Problem, Waiting Customers, Chair and Sleeps, Barber Is Sleeping, New Customer Arrives, Barber Shop Hints, Customer Threads, Barber Invokes...
20points
Download points needed to download
this document
Download the document
Preview3 pages / 12
This is only a preview
3 shown on 12 pages
Download the document
This is only a preview
3 shown on 12 pages
Download the document
This is only a preview
3 shown on 12 pages
Download the document
This is only a preview
3 shown on 12 pages
Download the document

Operating Systems Lecture 14:

Deadlock and Starvation

1 Docsity.com

Potential Deadlock

I need quad A and B

I need quad B and C

I need quad C and B

I need quad D and A

Docsity.com

Actual Deadlock

HALT until B is free

HALT until C is free

HALT until D is free

HALT until A is free

Docsity.com

Deadlock

• A set of processes is deadlocked when each process in the set is blocked awaiting an event that can only be triggered by another blocked process in the set – Typically involves processes competing for the

same set of resources

• The bad news: no efficient solution

Docsity.com

Two Processes P and Q

• Two processes P and Q, each needing exclusive access to a resource A and B for a period of time

Docsity.com

Joint Progress Diagram of Deadlock

Docsity.com

Alternative logic

• Suppose that P does not need both resources at the same time so that the two processes have this form

Docsity.com

Diagram of alternative logic

Docsity.com

Resource Allocation Graphs

• Directed graph that depicts a state of the system of resources and processes

• Process == circle, Resource == square

Docsity.com

Resource Allocation Graphs

Docsity.com

11

Four Conditions for Deadlock 1. Mutual exclusion condition

– Only one process may use a resource at a time 2. Hold-and-wait condition

– A process may hold allocated resources while awaiting assignment of others

3. No preemption condition – No resource can be forcibly removed form a process holding it

4. Circular wait condition – A closed chain of processes exists, such that each process holds

at least one resource needed by the next process in the chain

Docsity.com

Cars in Intersection, again

Docsity.com

comments (0)
no comments were posted
be the one to write the first!
This is only a preview
3 shown on 12 pages
Download the document