Deadlocks Flashcards

1
Q

What is a deadlock?

A

Processes unable to make progress due to both waiting on the same resource

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

What are common causes of deadlocks?

A

Programming errors, wait and signal the wrong way round.

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

Conditions for a deadlock

A

Mutual exclusion
Hold and wait
No resource Preemption
Circular wait

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

Deadlock strategies

A

Prevention
Recovery
Ignore the problem

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

How do we prevent deadlocks?

A

Avoid mutual exclusion

No hold-and-wait, limit to one resource per thread.

Allow resource preemption

Circular wait, impose lock ordering.

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

What is mutual exclusion?

A

Only one process can use the resource at a given time.

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

How do we avoid deadlocks?

A

Processes declare maximum resources needed

Ensure the system is in a safe state. This occurs when there is a safe sequence of processes such that deadlock cannot occur.

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

How do we detect deadlocks?

A

Using a wait-for graph. If there are cycles, then deadlock is possible.

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

How do we recover from a deadlock?

A

Process termination, abort all deadlocks processes one at a time.

Resource pre-emption, select a victim to rollback

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