Chapter 6 (Concurrency: Deadlock and Starvation) Flashcards

1
Q

T/F There are a few efficient solutions for deadlocks

A

F, there is no efficient solution

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

What are the conditions for a deadlock?

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

What is hold and wait?

A

A process may hold allocated resources while awaiting assignment of other resources

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

What is no preemption?

A

No resource can be forcibly removed from a process holding it

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

What is a circular wait?

A

A closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain

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

Can you have a circular wait without one of the other deadlock conditions?

A

No. All other conditions must be present for a circular wait

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

T/F If you have mutual exclusion, hold and wait, and no preemption, you have a circular wait.

A

F, you can have those three conditions without having a circular wait. But you must have all 3 to have a circular wait.

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

What are the three general approaches to deal with deadlocks?

A

Prevention

Avoidance

Detection

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

What is prevention for dealing with deadlocks?

A

Prevent conditions necessary for deadlock

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

What is avoidance for dealing with deadlocks?

A

Allows the first three conditions and avoids the fourth dynamically

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

What is detection for dealing with deadlocks?

A

Detect if deadlock occurs and then deal with it

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

T/F There is no single effective strategy for dealing with all types of deadlocks

A

T

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

What are the two approaches to deadlock prevention?

A

Indirect

Direct

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

What do you do for the indirect approach to deadlock prevention?

A

Prevent the fourth condition (circular wait)

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

T/F Prevention and avoidance are more conservative

A

T

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

T/F Detection is more liberal/hands-off approach

A

T

17
Q

What are the two categories of resources?

A

Reusable

Consumable

18
Q

What is a reusable resource?

A

Used by one process at a time

19
Q

What is a consumable resource?

A

Can be created and destroyed

20
Q

What is an example of a reusable resource?

A

CPU

21
Q

What is an example of a consumable resource?

A

A message

22
Q

What are the drawbacks of hold and wait?

A

May have to wait a long time

A process may acquire and keep resources for a long time

A process may not know in advance what resources it will need