Step 1: Deadlock Recovery.
When a deadlock occurs, recovery is achieved through: - Process Termination: Ending one or more deadlock-involved processes to resolve circular waiting.
- Resource Preemption: Seizing resources from processes to break the hold-and-wait condition.
Step 2: Evaluation of Alternatives.
- (2) Non-preemption of Resources: This is a deadlock condition, not a recovery strategy.
- (3) Banker's Algorithm: A deadlock prevention method, inapplicable to post-deadlock recovery.
- (4) Circular Wait: A cause of deadlock, not a recovery technique.
Step 3: Determination.
The valid deadlock recovery method is process termination (1).
Complete the following statement by choosing the correct option.
For a deadlock to occur, the four conditions namely Mutual Exclusion, Hold and Wait, No preemption, Circular wait __________.
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock \(L\). The following scheme is used to own a resource instance:
function OwnResource(Resource R)
Acquire lock L // a global lock
if R is available then
Acquire R
Release lock L
else
if R is owned by another process P then
Terminate P, after releasing all resources owned by P
Acquire R
Restart P
Release lock L
end if
end if
end function
Which of the following choice(s) about the above scheme is/are correct?