(7) Deadlock Flashcards

1
Q

When is a thread deadlocked?

A

When it’s waiting for an event to occur that can never occur.

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

What four conditions must be present for a deadlock to be possible?

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 happens if you have an -irreducible- cycle?

A

A deadlock occurs

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

When can a graph be reduced by a thread?

A

If all of that threads requests can be granted meaning that the thread will eventually terminate.

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

What are the (Hold, Havender) Miscellaneous theroems?

A

There are no deadlocked threads iff the graph is completely reducible
The order of reductions is irrelevant.

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

How would you prevent deadlocks by targeting the Mutual Exclusion requirement?

A

Don’t require mutual exclusion for shareable (e.g read-only) files; but do for non-shareable resources.

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

How would you prevent deadlocks by targeting the Hold and Wait requirement?

A

Guarantee that whenever a process requests a resource it does not hold any other resources.

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

How would you prevent deadlocks by targeting the No Preemption requirement?

A

If a process holding some resources requests another unavailable resource then all resources currently held are released.
Only restart process when it can regain its old resources as well as the newly requested ones.

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

How would you prevent deadlocks by targeting the Circular Wait requirement?

A

Impose a total ordering of all resource types and requires that each process requests resources in an increasing order of enumeration.

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

What is detect and recover?

A

Every once in a while check to see if there is a deadlock and if there is then remove it.

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

What is a Safe State?

A

If there is a sequence of ALL processes in the systems such that for every Pi the resources that Pi can still request can be satisfied by the currently available resources and the resources held by all Pj where j

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

What is the relation between unsafe states and deadlocks?

A

Deadlocks are a subset of unsafe states.

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

What is deadlock detection?

A

You allow the system to enter the deadlock state
Run the detection algorithm (waits-for with cycle detection)
Recover

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