Ch.7 Flashcards
(11 cards)
Conditions for deadlocks to occur ( deadlock characterization)
- mutual exclusion
- hold and wait
- no preemption
Circular wait
Methods for handling deadlocks we
- ensure that the system will never enter a deadlock
- allow the system to enter a deadlock state and then recover
- ignore the problem and pretend that deadlocks never occur in the system
Deadlock detection
- allow system to enter deadlock state
- detection algorithm
- recovery scheme
Instances of a resource type
Available
Allocation
Request
Recovery a deadlock ways
- abort all deadlock process
- abort one process at a time until the deadlock circle is eliminated
How to choose which process to abort
- process priority
- progress
- resources used
- res courses needed
- impact on system
- nature of the process
Recovery from dead lock: resource preemption
- selecting a victim
- rollback
Starvation
Every process uses a resource in three steps
Request
Use
Release
Resource allocation graph
No cycles—> ???
Cycle exists—> ???
No deadlock
If only one instance per resource type—> dead lock
If several instances per resource type—> possibility of dead lock
If a system is in a safe state—>??
If a system is in an unsafe state—>??
Avoidance—>??
No deadlocks
Possibility of deadlocks
Ensure that a system will never renter an unsafe state
Single instance of a resource type use:—>??
Multiple instances per of a resource type use:—>??
Use a resource allocation graph
Use the bankers algorithm