chapter Flashcards
A deadlocked state occurs whenever ____.
A) a process is waiting for I/O to a device that does not exist
B) the system has no available free resources
C) every process in a set is waiting for an event that can only be caused by another process in the set
D) a process is unable to release its request for a resource after use
C- EVERY PROCESS IN A SET IS WAITING FOR AN EVENT THAT CAN ONLY BE CAUSED BY ANOTHER PROCESS IN THE SET
One necessary condition for deadlock is \_\_\_\_, which states that at least one resource must be held in a nonsharable mode. A) hold and wait B) mutual exclusion C) circular wait D) no preemption
B- MUTUAL EXCLUSION
The witness software product is a(n) ____.
A) lock-order verifier that uses mutual-exclusion locks to protect critical sections
B) modeler to develop resource allocation graphs
C) driver that can be used to prevent mutual exclusion for nonsharable resources
D) implementation of the banker’s algorithm available for most operating systems
A- LOCK-ORDER VERIFIER THAT USES MUTUAL-EXCLUSION LOCKS TO PROTECT CRITICAL SECTIONS
In a system resource-allocation graph, ____.
A) a directed edge from a process to a resource is called an assignment edge
B) a directed edge from a resource to a process is called a request edge
C) a directed edge from a process to resource is called a request edge
D) None of the above
C- A DIRECTED EDGE FROM A PROCESS TO A RESOURCE IS CALLED A REQUEST EDGE
A cycle in a resource-allocation graph is ____.
A) a necessary and sufficient condition for deadlock in the case that each resource has more than one instance
B) a necessary and sufficient condition for a deadlock in the case that each resource has exactly one instance
C) a sufficient condition for a deadlock in the case that each resource has more than once instance
D) is neither necessary nor sufficient for indicating deadlock in the case that each resource has exactly one instance
B- A NECESSARY AND SUFFICIENT CONDITION FOR A DEADLOCK IN THE CASE THAT EACH RESOURCE HAS EXACTLY ONE INSTANCE
Which of the following is most often used by operating systems to handle deadlocks?
A) Pretend that deadlocks never occur
B) Use protocols to prevent or avoid deadlocks
C) Detect and recover from deadlocks
D) None of the above
A- PRETEND THAT DEADLOCKS NEVER OCCUR
Which of the following statements is true?
A) A safe state is a deadlocked state.
B) A safe state may lead to a deadlocked state.
C) An unsafe state is necessarily, and by definition, always a deadlocked state.
D) An unsafe state may lead to a deadlocked state.
D- AN UNSAFE STATE MAY LEAD TO A DEADLOCKED STATE
Which of the following data structures in the banker’s algorithm is a vector of length m, where m is the number of resource types? A) Need B) Allocation C) Max D) Available
D- AVAILABLE
Describe the four conditions that must hold simultaneously in a system if a deadlock is to occur
For a set of processes to be deadlocked:
1- at least one resource must remain in a non-sharable mode
2- a process must hold at least one resource and be waiting to acquire additional resources held by other processes
3- resources in the system cannot be preempted
4- a circular wait has to exist between processes
What are the three general ways that a deadlock can be handled?
1- A deadlock can be prevented using protocols to ensure that a deadlock will never occur.
2- A system may allow a deadlock to occur, detect it, and recover from it.
3- An operating may just ignore the problem and pretend that deadlocks can never occur.
What is the difference between deadlock prevention and deadlock avoidance?
Deadlock prevention is a set of methods for ensuring that at least one of the necessary conditions for deadlock cannot hold. Deadlock avoidance requires that the operating system be given, in advance, additional information concerning which resources a process will request and use during its lifetime
What is one way to ensure that a circular-wait condition does not occur?
One way to ensure that this condition never holds is to impose a total ordering of all resource types and to require that each process requests resources in an increasing order of enumeration. This can be accomplished by assigning each resource type a unique integer number to determine whether one precedes another in the ordering
What does a claim edge signify in a resource-allocation graph?
A claim edge indicates that a process may request a resource at some time in the future. This edge resembles a request edge in direction but is represented in the graph by a dashed line.
Describe a wait-for graph and how it detects deadlock
If all resources have only a single instance, then we can define a deadlock-detection algorithm that uses a variant of the resource-allocation graph, called a wait-for graph. We obtain this graph from the resource-allocation graph by removing the resource nodes and collapsing the appropriate edges. To detect deadlocks, the system needs to maintain the wait-for graph and periodically invoke an algorithm that searches for a cycle in the graph.
T OR F:
The circular-wait condition for a deadlock implies the hold-and-wait condition.
TRUE