Deadlocks Flashcards

1
Q

Each process utilizes a resource as follows:

A

Request
Use
Release

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Deadlock Conditions?

A

Mutual Exclusion
Hold and Wait
No Preemption
Circular Wait

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Mutual Exclusion?

A

Only one process at a time can use a resource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Hold and Wait?

A

A process holding at least one resource is waiting to acquire additional resources held by other processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

No Preemption?

A

A resource can be released only voluntarily by the process holding it, after that process has completed its task

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Circular Wait?

A

There exists a set of waiting processes such that P0 is waiting for a resoruce that is help by P1, P1 is waiting for a resource that is held by P2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

2 edges?

A

Request Edge

Assignment Edge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Basic Facts of deadlock?

A

If graph contains no cycles - no deadlock
If graph contains a cycle -> if only one instance per resource type, then deadlock
if several instances per resource type, possibility of deadlock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Methods for handling deadlocks?

A

Deadlock Prevention

Deadlock Avoidance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Deadlock Prevention?

A

Mutual Exclusion

Hold and Wait

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Deadlock Avoidance?

A

Requires that the system has some additional a priori information available

Declares the maximum number of resources of each type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Safe State?

A

When process requests an available resource, system must decide if immediate allocation leaves the system in a safe statew

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When is System in a safe state?

A

If there exists a sequence of ALL the processes in the systems such that for each Pi, the resources that Pi can still request can be satisfied by currently available resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Basic Safe State facts?

A

If in a safe state then no deadlocks

If in unsafe state possibility of a deadlock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Avoidance Algorithms?

A

Single instance of a resource type
* use resource-allocation graph

Multiple instances of a resource type
* Use banker’s algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Banker’s Algorithm?

A

Multiple instances
Each process must a priori claim maximum use
When a process requests a resource it may have to wait
When process gets all its resources it must return them in a finite amount of time

17
Q

Data Structures for Banker’s Algorithm

A

Available
Max
Allocation
Need

18
Q

Recovery from Deadlock?

A

Abort all deadlocked processes

Abort one process at a time until the deadlock cycle is eliminated

19
Q

Resource Preemption?

A

Selecting a victim
Rollback
Starvation