Bird
Raised Fist0

If a process P1 holds resource R1 and requests R2 held by P2, but P2 is preempted and forced to release R2, what deadlock condition is being violated to prevent deadlock?

medium🧠🧾 Concept Trace Q4 of Q15
Operating Systems - Deadlock - Four Necessary Conditions (Coffman)
Consider a system where processes can be preempted and resources forcibly taken away. If a process P1 holds resource R1 and requests R2 held by P2, but P2 is preempted and forced to release R2, what deadlock condition is being violated to prevent deadlock?
AMutual Exclusion
BNo Preemption
CCircular Wait
DHold and Wait
Step-by-Step Solution
Solution:
  1. Step 1: Understand the scenario

    Process P2 is forcibly preempted and releases resource R2.
  2. Step 2: Identify which deadlock condition is broken

    No Preemption means resources cannot be forcibly taken away. Here, preemption occurs, so No Preemption is violated.
  3. Step 3: Why others are incorrect

    Mutual Exclusion still holds if resource is exclusive, Hold and Wait may still hold, Circular Wait may or may not hold.
  4. Final Answer:

    Option B -> Option B
  5. Quick Check:

    Resource forcibly taken -> No Preemption violated [OK]
Quick Trick: Preemption breaks No Preemption condition [OK]
Common Mistakes:
MISTAKES
  • Confusing preemption with hold and wait
  • Assuming mutual exclusion is broken by preemption
Trap Explanation:
PITFALL
  • Candidates often overlook that preemption directly violates the No Preemption condition.
Interviewer Note:
CONTEXT
  • Checks understanding of how preemption affects deadlock conditions.
Master "Deadlock - Four Necessary Conditions (Coffman)" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes