📝 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 with minimum cost function .
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.
📝 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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?
📖 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.