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 __________.
Step 1: Explanation of deadlock conditions.
For a deadlock to occur, **all four necessary conditions** must hold simultaneously:
1. **Mutual Exclusion**: At least one resource is held in a non-shareable mode.
2. **Hold and Wait**: A process holding at least one resource is waiting to acquire additional resources.
3. **No Preemption**: Resources cannot be forcibly removed from processes holding them.
4. **Circular Wait**: A set of processes are waiting for each other in a circular chain.
Step 2: Conclusion.
All four conditions must be present for a deadlock to occur, meaning they **must hold simultaneously**.
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?