Chapter 6 - Deadlocks
Chapter 6 - Deadlocks
Chapter 6: Deadlocks
----
1. What is a deadlock in an operating system?
a) When a process is unable to complete its execution because it is waiting for
some resource held by another process.
b) When a process has completed its execution and has exited the system.
c) When a process is unable to start its execution because it is waiting for some
resource.
d) When a process has completed its execution and has returned control to the
operating system.
Answer: a) When a process is unable to complete its execution because it is waiting
for some resource held by another process.
11. Which of the following is not one of the necessary conditions for a deadlock to
occur?
a) Mutual exclusion
b) Hold and wait
c) No preemption
d) Concurrent execution
Answer: d) Concurrent execution.
17. Which of the following is a drawback of using the deadlock detection algorithm?
a) It can cause starvation
b) It requires a lot of processing power
c) It cannot prevent all deadlocks
d) It is not scalable
Answer: b) It requires a lot of processing power.
18. Which of the following is a drawback of using the deadlock recovery algorithm?
a) It is slow
b) It can cause data loss
c) It requires a lot of processing power
d) It cannot prevent all deadlocks
Answer: b) It can cause data loss.
20. Which of the following is a condition required for the Banker's algorithm to
work correctly?
a) Processes must request all resources at once
b) Processes must release all resources at once
c) The total number of resources must be fixed
d) Processes must always hold all resources they are granted
Answer: c) The total number of resources must be fixed.
27. Which of the following is not a resource allocation strategy in the Banker's
algorithm?
a) Request
b) Release
c) Check
d) Allocate
Answer: c) Check
36. Which of the following is not a necessary condition for deadlock to occur?
a) Mutual exclusion
b) Hold and wait
c) No preemption
d) Resource allocation graph
Answer: d
43. Which of the following is not a resource allocation strategy for deadlock
prevention?
a) First-come, first-served
b) Banker's algorithm
c) Round-robin
d) Priority
Answer: c
49. Which of the following is not a necessary condition for a deadlock to occur?
a) Mutual exclusion
b) Hold and wait
c) No preemption
d) Resource allocation graph is acyclic
Answer: d) Resource allocation graph is acyclic
51. Which of the following deadlock prevention techniques ensures that there is
always enough resources available for all processes to complete?
a) Resource allocation
b) Process termination
c) Spooling
d) Deadlock avoidance
Answer: a) Resource allocation
53. Which of the following deadlock avoidance algorithms ensures that a process
will not request more resources than it needs?
a) Banker's algorithm
b) Wait-die algorithm
c) Wound-wait algorithm
d) Coffman's algorithm
Answer: a) Banker's algorithm
55. Which of the following deadlock detection algorithms uses a depth-first search
to check for cycles in the resource allocation graph?
a) Banker's algorithm
b) Wait-die algorithm
c) Wound-wait algorithm
d) Coffman's algorithm
Answer: d) Coffman's algorithm