CSCI 343 Chapter 8

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

D (An unsafe state may lead to a deadlocked state.)

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.

True

Deadlock occurs when every thread in a set is blocked waiting for an event that can be caused only by another thread in the set, while livelock occurs when a thread continuously attempts an action that fails. True False

False

Deadlock prevention by denying the mutual-exclusion condition is the simplest way to prevent deadlocks. True False

False

If a resource-allocation graph has a cycle, the system must be in a deadlocked state. True False

D (All of the above)

Most operating systems choose to ignore deadlocks, because A) handling deadlocks is expensive in terms of performance and resources. B) deadlocks occur infrequently. D) methods used to recover from livelock may be put to use to recover from deadlock. D) All of the above.

A (hold and wait)

One necessary condition for deadlock is ____, which states that a process must be holding one resource and waiting to acquire additional resources. A) hold and wait B) mutual exclusion C) circular wait D) no preemption

A) pretend that deadlocks never occur

To handle deadlocks, operating systems most often ____. 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

D (All of the above.)

To recover from a deadlock using resource preemption, A) the order of resources and processes that need to be preempted must be determined to minimize cost. B) if a resource is preempted from a process, the process must be rolled back to some safe state and restarted from that state. C) ensure that starvation does not occur from always preempting resources from the same process. D) All of the above.

B (a necessary and sufficient condition for a deadlock in the case that each resource has exactly one instance)

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

C (every process in a set is waiting for an event that can only be caused by another process in the set)

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

D (All of the above.)

A system can recover from a deadlock by A) aborting one process at a time until the deadlock cycle is eliminated. B) aborting all deadlocked processes. C) preempting some resources from one or more of the deadlocked threads. D) All of the above.

D (R2, R1, R3)

Assume there are three resources, R1, R2, and R3, that are each assigned unique integer values 15, 10, and 25, respectively. What is a resource ordering which prevents a circular wait? A) R1, R2, R3 B) R3, R2, R1 C) R3, R1, R2 D) R2, R1, R3

True

Both deadlock prevention and deadlock avoidance techniques ensure that the system will never enter a deadlocked state. True False

D (None of the above.)

In a wait-for-graph, A) a resource may have multiple instances. B) a deadlock implies the existence of a cycle, but a cycle does not necessarily imply a deadlock. C) a cycle implies deadlock, but not every deadlock results in a cycle. D) None of the above.

D (All of the above.)

In deadlock prevention by denying hold-and-wait condition, A) resource utilization may below. B) starvation is possible. C) whenever a thread requests a resource, it does not hold any other resources. D) All of the above.

False

In the dining philosophers problem, there is a possibility of deadlock but not livelock. True False

True

The decision of when to invoke a detection algorithm depends on the likely frequency of deadlocks and the number of threads likely to be affected by a deadlock when it happens. True False

True

The wait-for graph scheme is not applicable to a resource allocation system with multiple instances of each resource type. True False


Ensembles d'études connexes

Eternal Families Final Exam Study

View Set

Holt Alegebra 1 Chapter 1 Vocabulary

View Set

Chapter 2 - Determinant of Interest Rates SB

View Set