- a resource - anything required by a process
- anything - os as resource manager
- process - owns the resource
- required - no resource, no progress; adaptive processes
- resources - sharable, serially reusable, and consumable
- resource management - protection, economy, and convenience
- fairness, policy and mechanism
- the deadlock problem
- deadlock background
- a very old problem - train track management; gridlock
- os can suffer from deadlock too
- finite, non sharable resources lead to deadlock
- a global condition, which makes it difficult to find and deal with
- deadlock handling techniques - reboot, prevention, avoidance, detect and
recover
- reboot - the traditional technique
- prevention
- the four deadlock conditions
- exclusive access to resources - no sharing
- incremental allocation - many points at which a process can block
- circular waiting - no progress
- no take-backs - only the process can release resources
- these are necessary conditions - if any is missing, deadlock can't occur
- sharing - no waiting; good - simple, improves utility; bad - can be expensive
- bulk allocation - ask for everything up front; good - simple and
cheap management; bad - difficult to do, inefficient
- ordered resources - no backwards waiting; good - incremental,
efficient; bad - difficult to find orders, still inefficient
- pre-emption - retreived locked resources; good - selective recovery;
bad - hard to do well, hard to deal with
- avoidance
- always monitoring all processes for everything is expensive and
restrictive
- safe, unsafe, and deadlock states - unsafe states could go either way
- monitor processes in the unsafe state to keep them from deadlock
- the banker's algorithm
- given a set of maximum claims, how much is needed to cover - the
maximum maximum
- assumptions - a maximum claim, non-maximum requests, no pre-emption,
requests satisfied in any order
- objective - if no process is maxed, make sure there's always enough
on hand to satisfy some maximum;
- procedure - deny any non-maximum request that violates the objective
- detection and recovery
- model the system and determine if the model indicates deadlock - a
reactive approach
- system state model - a directed graph
- each state represents some allocation of available resources
- each edge represents a process's request, allocation, or release
- a state with no outward edges is a deadlock state
- this is a large, expensive representation - exponential in resources
- with one resource this turns into state-based protocol analysis
- resource graphs - a directed, bipartite graph
- each node is either a process or a resource
- edges indicate requests (from p to r) or allocations (from r to p)
- a cycle in the resource graph indicates a deadlock
- extendable to multiple resources, but with difficulty - knots instead
of cycles
- recovery
- reboot, selective pre-emption, delete processes, check-point and roll
back
This page last modified on 25 June 2002.