Bird
Raised Fist0

Why?

hard🤔 Reasoning Q9 of Q15
Operating Systems - Deadlock - Four Necessary Conditions (Coffman)
In designing a system to avoid deadlocks during multiple resource locking, which approach is generally more efficient: (1) enforcing a global resource acquisition order, or (2) using dynamic deadlock detection with rollback? Why?
ANeither approach affects deadlock occurrence or system efficiency
BDynamic detection with rollback is more efficient because it avoids restricting resource acquisition order
CBoth approaches have equal efficiency in all scenarios
DEnforcing a global order is more efficient because it prevents deadlocks proactively without runtime overhead
Step-by-Step Solution
Solution:
  1. Step 1: Understand global ordering

    Enforcing a strict order prevents circular wait, thus preventing deadlocks proactively.
  2. Step 2: Understand dynamic detection

    Dynamic detection incurs runtime overhead and may require rollback, impacting performance.
  3. Step 3: Compare efficiency

    Global ordering avoids runtime overhead, making it generally more efficient.
  4. Final Answer:

    Option D -> Option D
  5. Quick Check:

    Proactive prevention avoids overhead [OK]
Quick Trick: Prevent deadlocks proactively to reduce overhead [OK]
Common Mistakes:
MISTAKES
  • Assuming dynamic detection is always more efficient
  • Believing global ordering restricts concurrency excessively
  • Ignoring rollback costs in dynamic detection
Trap Explanation:
PITFALL
  • Dynamic detection seems flexible but ignores overhead and rollback costs.
Interviewer Note:
CONTEXT
  • Tests ability to evaluate deadlock prevention vs detection trade-offs.
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