Deadlock Flashcards
Try to explain deadlock in a sentence
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
What are the four conditions for deadlock
Mutual exclusion
No preemption
Hold and wait
Circular wait
Explain mutual exclusion in relation to deadlock
a singular resource is currently held by one process
Explain hold and wait in relation to deadlock
a process or process currently holding resources can ask for more resources
Explain ‘no preemption’ in relation to deadlock
once a process holds a resource, this cannot be taken away from it
Explain ‘circular wait’ in relation to deadlock
each process is waiting to get access to a resource held by another process
Name the three ways typically used to handle deadlock
Ignoring it (ostrich)
Detection and recovery
Dynamic allocation of resources
Why is dynamic allocation of resources problematic
You have to be able to preempt resources for a process. Once a human touches it = you’re fucked.
Once deadlock has occurred, what are the four things you can do?
Abort everything
Backup processes to a checkpoint
Abort processes and restart them again
What are the four things associated with critical regions and deadlock prevention to be mindful of
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.