🎓 BookMCQ
← Back to 7. Deadlocks

📝 Process Termination and Recovery from Deadlock (22 MCQs)

📖 From Operating System • 7. Deadlocks • 22 questions available

What is Process Termination and Recovery from Deadlock?

Definition:
This recovery method aborts one or more deadlocked processes to break the circular wait, choosing victims based on priority, age, or resource usage.

Example:
Terminate process PkP_k with minimum cost function f(Pk)=w1priority+w2CPU_time+w3resources_heldf(P_k) = w_1 \cdot priority + w_2 \cdot CPU\_time + w_3 \cdot resources\_held.

Reason:
Termination is simple to implement and guarantees deadlock resolution, but may cause loss of partial computation and requires careful victim selection to minimize system impact.

6
Easy
8
Medium
8
Hard

📝 All Process Termination and Recovery from Deadlock MCQs

Q1. Which method of process termination guarantees the deadlock cycle will be broken but at the highest cost?

A.Terminating processes in reverse priority order
B.Aborting all deadlocked processes simultaneously ✅
C.Killing processes with minimal resource usage
D.Suspending processes temporarily
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Aborting all deadlocked processes is the most straightforward method to break a deadlock cycle. However, it comes at great expense because all partial computations are discarded, and significant processing time is wasted. This approach guarantees resolution but sacrifices efficiency and resource utilization.

Q2. What is the primary disadvantage of aborting all deadlocked processes to resolve a deadlock?

A.The system must re-run deadlock detection repeatedly
B.Only interactive processes are affected
C.Partial computations must be discarded and recomputed later ✅
D.Resources are not reclaimed properly
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The major drawback of aborting all deadlocked processes is that any partial computations performed by these processes are lost. This means the system must discard the work already done, and these computations will need to be redone from scratch, leading to significant inefficiency and wasted CPU time.

Q3. When the system aborts all deadlocked processes, what happens to the resources allocated to them?

A.Resources are permanently lost
B.Resources are reclaimed by the system ✅
C.Resources are transferred to other deadlocked processes
D.Resources remain allocated until system reboot
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: In both termination methods, the system reclaims all resources allocated to terminated processes. This reclamation makes resources available for other processes, effectively breaking the deadlock cycle by removing the resource hold that caused the deadlock.

Q4. Under what scenario would aborting all deadlocked processes be considered acceptable despite its cost?

A.When processes are all non-interactive
B.When processes have minimal computation time invested ✅
C.When deadlock occurs in a non-critical system
D.When data integrity is not a concern
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Aborting all deadlocked processes is more acceptable when the processes have not computed for long and have minimal partial results to discard. The cost is measured in wasted computation, so processes with shorter execution times represent less economic loss if terminated and restarted.

Q5. What overhead is incurred when aborting one process at a time to eliminate deadlock?

A.The system must save process states repeatedly
B.Deadlock-detection algorithm must run after each abortion ✅
C.All resources must be preempted before each abortion
D.Process priorities must be recalculated
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: When aborting one process at a time, the deadlock-detection algorithm must be invoked after each process termination to check if the deadlock cycle still exists. This repeated detection incurs considerable computational overhead, especially in systems with many processes and resources.

Q6. How does the one-process-at-a-time termination approach compare to aborting all processes in terms of resource utilization?

A.It wastes more resources overall
B.It reclaims resources faster
C.It may preserve more completed work ✅
D.It requires less detection overhead
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The partial termination approach is more selective and may preserve work from processes that are not terminated. By carefully choosing which process to abort, the system can break the deadlock while allowing other processes to continue and complete their tasks, potentially saving computational effort that would be wasted in the all-process approach.

Q7. What is the primary challenge when implementing the one-process-at-a-time termination method?

A.Identifying the deadlock cycle is impossible
B.Determining which process to terminate is a policy decision ✅
C.The system cannot reclaim resources from terminated processes
D.All processes must be non-interactive
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Choosing which deadlocked process to terminate is a policy decision, similar to CPU scheduling decisions. This is challenging because it involves economic considerations - the system must evaluate multiple factors like priority, computation time, and resource usage to minimize the cost of termination while effectively breaking the deadlock cycle.

Q8. In the sequential abortion method, why must the deadlock-detection algorithm be re-executed after each termination?

A.To verify the system is still running
B.To confirm resources were properly reclaimed
C.To check if remaining processes are still deadlocked ✅
D.To update process priority queues
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: The deadlock-detection algorithm must be re-executed after each abortion to verify whether the deadlock cycle has been completely broken. Since multiple processes may be involved in the cycle, terminating one process may not resolve the deadlock if other processes remain in a circular wait. Re-execution ensures accurate determination of when the deadlock has been fully eliminated.

Q9. What problem can occur if a process is terminated while updating a file?

A.The file system becomes corrupted
B.The file is left in an incorrect state ✅
C.All files are automatically restored
D.The operating system crashes
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: If a process is terminated during a file update operation, the file may be left in an inconsistent or incorrect state. This occurs because the update operation may have been partially completed, leaving the file with incomplete modifications that violate its structural or logical integrity.

Q10. When a process is terminated while printing, what action must the system take?

A.Restart the entire operating system
B.Reset the printer to a correct state ✅
C.Ignore the printing error
D.Delete all print jobs
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The system must reset the printer to a correct state before printing the next job. This ensures that the printer's internal state, buffers, and control information are properly initialized, preventing data corruption or incorrect output on subsequent print jobs.

Q11. What factor makes aborting a process complex even after the system decides to do so?

A.Processes cannot be terminated by the operating system
B.The process may be in the middle of an I/O operation ✅
C.The system must restart all services
D.Process termination always requires user approval
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Aborting a process is complex because it may be in the midst of critical operations like file updates or printing. The system must handle these side effects properly, such as resetting device states or ensuring file integrity, which adds operational complexity beyond simply reclaiming resources.

Q12. Which factor is considered an economic decision when selecting a process for termination?

A.The operating system version
B.The process's priority level ✅
C.The number of CPU cores available
D.The amount of RAM installed
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Process priority is an economic factor because terminating a high-priority process may incur greater cost in terms of lost work or service quality. The system must weigh this against the benefits of breaking the deadlock, making it a cost-benefit economic decision similar to CPU scheduling policies.

Q13. When choosing a process to terminate, why is the computation time already invested important?

A.It determines the process's memory usage
B.It represents potential work that will be lost ✅
C.It indicates the process's priority
D.It affects system boot time
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The computation time a process has already invested represents work that will be discarded if the process is terminated. Processes that have computed for longer periods have more partial results that would be lost, making their termination more costly in terms of wasted CPU resources and time.

Q14. What resource-related factor should be evaluated when selecting a process for termination?

A.Total system memory size
B.Types of resources the process has used ✅
C.CPU clock speed
D.Disk storage capacity
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The types of resources a process has used is an important factor because some resources are easier to preempt or reset than others. For example, terminating a process holding a simple memory resource may be less complex than terminating one holding a physical device that requires state restoration.

Q15. How do future resource requirements affect the decision of which process to terminate?

A.They indicate how long termination will take
B.They help estimate the cost of keeping the process alive ✅
C.They determine process priority automatically
D.They have no effect on termination decisions
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Future resource requirements help estimate the ongoing cost of keeping a process alive. Processes needing many additional resources to complete may consume scarce resources for extended periods, making them candidates for termination to free resources for more efficient processes. This forward-looking analysis supports the economic decision model.

Q16. What relationship exists between process termination decisions and CPU scheduling decisions?

A.They are completely unrelated
B.Both are policy decisions based on economic factors ✅
C.Termination decisions override scheduling
D.Scheduling determines which processes to terminate
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Both process termination decisions and CPU scheduling decisions are policy decisions based on economic factors. They require evaluating trade-offs between costs and benefits, such as which process provides the most value, deserves priority, or minimizes resource waste. This makes them both examples of resource allocation policy problems in operating systems.

Q17. Which factor would most strongly suggest keeping a process alive rather than terminating it?

A.The process is batch-oriented
B.The process is interactive with a user ✅
C.The process has used minimal resources
D.The process has just started executing
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Interactive processes typically have a user waiting for results, making their termination more costly in terms of user experience and perceived system responsiveness. Users would lose unsaved work and have to restart their sessions, so economic factors favor keeping interactive processes alive unless absolutely necessary.

Q18. What is the significance of whether a process is interactive or batch when deciding termination?

A.Batch processes cannot be terminated
B.Interactive processes have higher priority by default
C.Interactive processes involve user impact ✅
D.Batch processes always get terminated first
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Interactive processes have users actively waiting for results, so terminating them directly affects user experience and may cause loss of unsaved work. Batch processes, running without direct user interaction, are generally easier to terminate and restart, making the interactive vs batch distinction important in termination decisions.

Q19. If multiple processes are deadlocked, which process should be terminated to minimize cost?

A.The process with the highest memory usage
B.The process that will complete its task soonest ✅
C.The process with the lowest priority
D.The process that requires the most resources
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: A process that will complete its task soonest represents a significant investment of CPU time that is close to producing results. Terminating such a process would waste nearly-completed work, making it economically costly. The system should consider remaining computation time and prioritize keeping processes with imminent completion to preserve valuable computational effort.

Q20. What happens to system resources when a process involved in a deadlock is terminated?

A.Resources are allocated to the highest priority process
B.Resources are reclaimed by the operating system ✅
C.Resources remain in a locked state
D.Resources are permanently deallocated
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: When a process involved in a deadlock is terminated, the operating system reclaims all resources that were allocated to that process. This resource reclamation is essential for breaking the circular wait condition of the deadlock, making resources available for other processes to use.

Q21. How does the number of processes that will need to be terminated factor into the termination decision?

A.It has no impact on the decision
B.It determines the system's maximum process count
C.It affects the overall cost of resolution ✅
D.It influences only interactive processes
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The number of processes requiring termination directly affects the total cost of deadlock resolution. Terminating fewer processes preserves more computational work and reduces system disruption, while terminating many processes may waste significant resources. This consideration helps balance the economic costs in the policy decision.

Q22. Why is resource reclamation guaranteed in both termination methods?

A.To satisfy deadlock detection requirements
B.To ensure the deadlock cycle is completely broken
C.To maintain system stability after termination
D.All of the above ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Resource reclamation is fundamental to resolving deadlocks. By reclaiming resources, the system breaks the circular wait condition, ensures that no resources remain permanently held by terminated processes, and maintains system stability. This comprehensive reclamation is essential for both effective deadlock resolution and maintaining overall system integrity.

🔗 Related Topics (MCQs)