Chapter 6 (Concurrency: Deadlock and Starvation) Flashcards
T/F There are a few efficient solutions for deadlocks
F, there is no efficient solution
What are the conditions for a deadlock?
Mutual exclusion
Hold and wait
No preemption
Circular wait
What is hold and wait?
A process may hold allocated resources while awaiting assignment of other resources
What is no preemption?
No resource can be forcibly removed from a process holding it
What is a circular wait?
A closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain
Can you have a circular wait without one of the other deadlock conditions?
No. All other conditions must be present for a circular wait
T/F If you have mutual exclusion, hold and wait, and no preemption, you have a circular wait.
F, you can have those three conditions without having a circular wait. But you must have all 3 to have a circular wait.
What are the three general approaches to deal with deadlocks?
Prevention
Avoidance
Detection
What is prevention for dealing with deadlocks?
Prevent conditions necessary for deadlock
What is avoidance for dealing with deadlocks?
Allows the first three conditions and avoids the fourth dynamically
What is detection for dealing with deadlocks?
Detect if deadlock occurs and then deal with it
T/F There is no single effective strategy for dealing with all types of deadlocks
T
What are the two approaches to deadlock prevention?
Indirect
Direct
What do you do for the indirect approach to deadlock prevention?
Prevent the fourth condition (circular wait)
T/F Prevention and avoidance are more conservative
T