Deadlocks - deadlock characterization, prevention, avoidance, detection and recovery methods - Question Bank

1. Which of the following is a characteristic of the 'Circular Wait' condition for deadlock?
A) A process holds at least one resource and waits for another resource held by a different process.
B) A process must release all its resources before requesting a new one.
C) A set of processes {P0, P1, ..., Pn} exists such that P0 is waiting for a resource held by P1, P1 is waiting for a resource held by P2, ..., and Pn is waiting for a resource held by P0.
D) At least one resource must be held in a non-sharable mode.
2. What is the primary goal of deadlock detection algorithms?
A) To prevent deadlocks from ever occurring.
B) To ensure the system always remains in a safe state.
C) To identify when a deadlock has occurred and take action.
D) To eliminate the possibility of resource contention.
3. Which method of deadlock recovery involves selecting a process and restarting it from a previous checkpoint?
A) Process Termination
B) Resource Preemption
C) Rollback
D) System Restart
4. In the Banker's Algorithm, if a process requests more resources than its maximum declared need, what is the consequence?
A) The request is immediately granted.
B) The system enters an unsafe state.
C) The request is denied, and the process may be terminated.
D) The process is put into a waiting state indefinitely.
5. Which of the following is a condition for deadlock that states that a process will not be preempted until it voluntarily releases the resource?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
6. What is the fundamental difference between deadlock prevention and deadlock avoidance?
A) Prevention actively prevents deadlock conditions, while avoidance dynamically checks for safe states.
B) Prevention is more efficient than avoidance.
C) Avoidance detects deadlocks after they occur, while prevention tries to stop them before.
D) Prevention requires more system resources than avoidance.
7. Which of the following is a deadlock prevention technique that involves ordering all resource types?
A) Disallow Hold and Wait
B) Disallow Circular Wait
C) Disallow No Preemption
D) Disallow Mutual Exclusion
8. When recovering from a deadlock by aborting a process, what is a common strategy to minimize cost?
A) Abort the process that has made the most progress.
B) Abort the process that has acquired the most resources.
C) Abort the process that has made the least progress.
D) Abort the process with the highest priority.
9. Which of the following is a deadlock detection algorithm that relies on checking for cycles in a graph?
A) Banker's Algorithm
B) Wait-for Graph Cycle Detection
C) Resource Counting
D) Priority Queuing
10. What is the purpose of the 'Allocation' matrix in the Banker's Algorithm?
A) To track the maximum resources a process might need.
B) To track the resources currently held by each process.
C) To track the available resources in the system.
D) To track the remaining resources a process needs.
11. Which condition for deadlock is violated if a process releases all its resources before acquiring new ones?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
12. What is a potential disadvantage of using deadlock prevention methods?
A) They can lead to starvation of processes.
B) They can significantly reduce the degree of concurrency and system utilization.
C) They are difficult to implement in distributed systems.
D) They require a complex scheduling algorithm.
13. Which deadlock recovery strategy involves choosing a process and preempting its resources until the deadlock is resolved?
A) Process Termination
B) Resource Preemption
C) Rollback
D) System Restart
14. A cycle in a Resource Allocation Graph with multiple instances of each resource type implies:
A) A definite deadlock.
B) No deadlock.
C) A necessary but not sufficient condition for deadlock.
D) A safe state.
15. In the Banker's Algorithm, what does the 'Max' matrix represent?
A) The maximum number of resources of each type that a process may request.
B) The number of resources of each type currently allocated to each process.
C) The remaining resources of each type that a process may still request to complete its task.
D) The total number of resources of each type available in the system.
16. Which of the following is a deadlock prevention strategy that requires a process to request all of its resources at one time?
A) Disallowing Mutual Exclusion
B) Disallowing Hold and Wait
C) Disallowing No Preemption
D) Disallowing Circular Wait
17. If a process is preempted and its resources are taken away, which deadlock condition is being violated?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
18. Which of the following is a condition that MUST hold for a deadlock to occur?
A) Progress
B) Fairness
C) Mutual Exclusion
D) Priority Inversion
19. When recovering from a deadlock by preempting resources, what is a common criterion for selecting a victim process?
A) The process that has acquired the fewest resources.
B) The process that has made the most progress.
C) The process that has the lowest priority.
D) The process that has acquired the most resources.
20. Which of the following is a method of deadlock detection that works by trying to find a sequence of process completions?
A) Wait-for Graph
B) Resource Allocation Graph
C) Detection Algorithm based on Available and Allocation Matrices
D) Priority-based Scheduling
21. In deadlock avoidance, a 'safe state' guarantees that:
A) No deadlock will ever occur.
B) The system can avoid deadlock in the immediate future.
C) The system can allocate resources to each process in some sequence without causing deadlock.
D) All processes will complete within a bounded time.
22. What is the 'Progress' condition, which is NOT necessary for deadlock, often related to?
A) Resource allocation fairness
B) System throughput
C) Process scheduling and execution order
D) Memory management
23. Which of the following is a method of deadlock prevention that involves ensuring that processes do not request resources in a circular manner?
A) Disallowing Hold and Wait
B) Disallowing Mutual Exclusion
C) Disallowing Circular Wait
D) Disallowing No Preemption
24. Which recovery strategy involves aborting all deadlocked processes?
A) Abort one process at a time
B) Abort all deadlocked processes
C) Resource preemption
D) Rollback
25. In a Resource Allocation Graph, a cycle indicates:
A) That the system is in a safe state.
B) A potential for deadlock, or an actual deadlock if there is only one instance per resource type.
C) That no deadlock can occur.
D) That all processes have finished execution.
26. The Banker's Algorithm is primarily used for:
A) Deadlock Detection
B) Deadlock Prevention
C) Deadlock Avoidance
D) Deadlock Recovery
27. Which of the following is a characteristic of the 'No Preemption' condition for deadlock?
A) If a process holding resources requests another resource that cannot be immediately allocated to it, then the process releases all currently held resources.
B) A process can be preempted and have its resources taken away.
C) Resources can only be released voluntarily by the process holding them.
D) Processes must request all their resources before starting execution.
28. Which condition for deadlock is violated if a process can be forced to release its resources even if it is still using them?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
29. In deadlock recovery, what is the process of 'Rollback'?
A) Terminating a process and reclaiming its resources.
B) Selecting a process and preempting its resources.
C) Restoring a process to a previously defined safe state.
D) Restarting the entire system.
30. Which of the following is a common representation for detecting deadlocks in a system with multiple instances of each resource type?
A) Wait-for Graph
B) Resource Allocation Graph
C) Detection Algorithm using Available and Allocation Matrices
D) Process Dependency Chart
31. Which of the following is a strategy for deadlock prevention by ensuring that once a process has started using a resource, it cannot be preempted?
A) Allowing processes to request all resources upfront.
B) Releasing all held resources when requesting a new one.
C) Not allowing processes to hold resources while waiting for others.
D) Ensuring that processes are not allowed to hold resources indefinitely.
32. What is the main challenge with deadlock detection algorithms?
A) They are too complex to implement.
B) They can lead to frequent false positives.
C) They can be computationally expensive, especially with many processes and resources.
D) They require the system to be in a deadlock state to function.
33. Which of the following is a method to recover from deadlock by selecting a victim process and aborting it?
A) Resource Preemption
B) Process Termination
C) Rollback
D) System Restart
34. In the context of deadlock avoidance, what does the 'Available' vector represent in the Banker's Algorithm?
A) The total number of instances of each resource type in the system.
B) The number of instances of each resource type currently allocated to processes.
C) The number of instances of each resource type currently available for allocation.
D) The maximum demand of instances of each resource type by processes.
35. Which condition is violated by setting all resources to be shareable?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
36. What is the 'Mutual Exclusion' condition for deadlock?
A) A set of processes is waiting for each other in a circular fashion.
B) A process holds at least one resource and is waiting to acquire additional resources held by other processes.
C) At least one resource must be held in a non-sharable mode; otherwise, no deadlock can occur.
D) A process can be preempted from a resource only after it has finished using it.
37. Which of the following is a disadvantage of deadlock prevention techniques?
A) They are computationally expensive.
B) They reduce resource utilization and system throughput.
C) They do not guarantee prevention.
D) They require significant hardware support.
38. When recovering from a deadlock by preempting resources, what is a critical consideration?
A) Preempting from the process with the fewest resources.
B) Preempting from the process that has made the most progress.
C) Preempting from the process that is least likely to cause starvation.
D) Preempting from a process that will not require the resource again.
39. Which of the following is a method for deadlock detection that involves maintaining a matrix of available resources and resource requests?
A) Wait-for Graph
B) Resource Allocation Graph
C) Algorithm based on available and allocation matrices
D) Process State Monitoring
40. A state is considered 'safe' in the Banker's Algorithm if:
A) There is no process currently waiting for resources.
B) The system can allocate resources to each process in some order and still avoid deadlock.
C) All processes have completed their execution.
D) The system has enough free resources to satisfy all pending requests.
41. Which condition for deadlock is violated if a process can be forced to relinquish resources it holds?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
42. What is the primary goal of deadlock avoidance algorithms?
A) To detect deadlocks after they have occurred.
B) To prevent deadlocks by ensuring safe states.
C) To recover from deadlocks by terminating processes.
D) To eliminate the need for any resource allocation checks.
43. If a deadlock is detected, which of the following is NOT a common recovery strategy?
A) Process termination (abort all or some processes).
B) Resource preemption (take resources from processes).
C) Rollback (restore processes to a safe state).
D) System reboot.
44. Which of the following is a deadlock detection algorithm that uses a wait-for graph?
A) Banker's Algorithm
B) Resource Allocation Graph
C) Cycle Detection Algorithm
D) Priority-based Detection
45. In the Banker's Algorithm, what does the 'Need' matrix represent?
A) The maximum number of resources of each type that a process may request.
B) The number of resources of each type currently allocated to each process.
C) The remaining resources of each type that a process may still request to complete its task.
D) The total number of resources of each type available in the system.
46. Which deadlock avoidance algorithm dynamically examines the resource allocation state to ensure that there is never a state where a circular wait condition can occur?
A) Banker's Algorithm
B) Resource Allocation Graph
C) Deadlock Detection Algorithm
D) Hierarchical Resource Allocation
47. Which of the following is a characteristic of the 'Hold and Wait' condition for deadlock?
A) A process holds at least one resource and waits for another resource held by a different process.
B) A process must release all its resources before requesting a new one.
C) A process can be preempted and have its resources taken away.
D) Processes form a circular chain where each process waits for the resource held by the next process.
48. Which deadlock prevention strategy involves ordering all resource types and requiring processes to request resources in increasing order of enumeration?
A) Disallowing Circular Wait
B) Disallowing Hold and Wait
C) Disallowing Mutual Exclusion
D) Disallowing No Preemption
49. In deadlock prevention, which condition is violated by ensuring that every process requests all its resources before it starts execution?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Circular Wait
50. Which of the following conditions is NOT necessary for a deadlock to occur?
A) Mutual Exclusion
B) Hold and Wait
C) No Preemption
D) Progress