Deadlocks Flashcards

1
Q

What is a deadlock?

A

A permanent blocking of a set of processes that are competing for resources

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

How do deadlocks occur?

A
  1. When 2 processes request the same resource that can’t be run twice at the same time
  2. When there is limited memory available and a process tries to request more memory than is available
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the preconditions that will lead to a deadlock?

A

Mutual exclusion - only one process can use a resource at a time

Hold-and-wait - a process can hold resources while it is waiting for other resources to become available

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

What is a condition that will lead to a deadlock?

A

Circular wait - Processes wait for each other to release resources they want to acquire, they form a kind of “closed chain of processes”

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

How to handle deadlocks with deadlock prevention?

A

Avoid at least 1 of the 4 deadlock conditions

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

How to handle deadlocks with deadlock avoidance?

A

Resources are reserved in a way so they do not lead to a deadlock

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

How to handle deadlocks with deadlock detection?

A
  1. There is no restriction on resource allocation
  2. There is a periodic check to see if a deadlock is occurring
  3. In case a deadlock is detected, recovery mechanisms are employed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly