Deadlock Flashcards

1
Q

Try to explain deadlock in a sentence

A

Where process A has resource A, wants resource B.
A goes into waiting.
Process B has resource B. It wants resource B.
B goes into waiting.
Nothing escapes = deadlock

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

What are the four conditions for deadlock

A

Mutual exclusion
No preemption
Hold and wait
Circular wait

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

Explain mutual exclusion in relation to deadlock

A

a singular resource is currently held by one process

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

Explain hold and wait in relation to deadlock

A

a process or process currently holding resources can ask for more resources

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

Explain ‘no preemption’ in relation to deadlock

A

once a process holds a resource, this cannot be taken away from it

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

Explain ‘circular wait’ in relation to deadlock

A

each process is waiting to get access to a resource held by another process

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

Name the three ways typically used to handle deadlock

A

Ignoring it (ostrich)
Detection and recovery
Dynamic allocation of resources

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

Why is dynamic allocation of resources problematic

A

You have to be able to preempt resources for a process. Once a human touches it = you’re fucked.

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

Once deadlock has occurred, what are the four things you can do?

A

Abort everything
Backup processes to a checkpoint
Abort processes and restart them again

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

What are the four things associated with critical regions and deadlock prevention to be mindful of

A

No two processes can enter a critical region = can’t request resources
No assumptions made about speed
No process outside critical region can interript something inside a critical region
Fairness still important, though, for scheduling.

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