Chapter 8 - Deadlocks Flashcards

1
Q

When does deadlock occur?

A

Deadlock occurs in a set of processes when every process in the set is waiting for an event that can only be caused by another process in the set.

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

What are the four necessary conditions for deadlock?

A

There are four necessary conditions for deadlock:
1. mutual exclusion
2. hold and wait
3. no preemtion
4. circular wait

Deadlockk is only possible when all four conditions are present.

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

How can deadlocks be modeled?

A

Deadlocks can be modeled with resource-allocation graphs, where a cycle indicates deadlock.

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

How can deadlocks be prevented?

A

Deadlocks can be prevented by ensuring that one of the four necessary conditions for deadlock cannot occur. Of the four necessary conditions, eliminating the circular wait is the only practical approach.

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

How can deadlock be avoided?

A

Deadlock can be avoided by using the banker’s algorithm, which does not grant resources if doing so would lead the system into an unsafe state where deadlock would be possible.

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

What is a deadlock-detection algorithm?

A

A deadlock-detection algorithm can evaluate processes and resources on a running system to determine if a set of processes is in a deadlocked state.

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

How can a system recover from a deadlock?

A

If deadlock does occur, a system can attempt to recover from the deadlock by either aborting one of the processes in teh circular wait or preempting resources that have been assigned to a deadlocked process.

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