Bird
Raised Fist0

In the five-state process model, what is the time complexity of transitioning a process from the Waiting state back to the Ready state when multiple I/O events complete simultaneously?

medium🪤 Complexity Trap Q5 of Q15
Operating Systems - Process State Machine - Five-State Model
In the five-state process model, what is the time complexity of transitioning a process from the Waiting state back to the Ready state when multiple I/O events complete simultaneously?
AO(n), where n is the number of I/O events the process is waiting for.
BO(1), because the process moves immediately after any I/O completion.
CO(log n), due to priority queue management of I/O completions.
DO(n²), because each I/O completion triggers multiple checks.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Waiting to Ready transition

    The process waits for multiple I/O events; it can only move to Ready after all required events complete.
  2. Step 2: Complexity depends on checking all events

    Checking completion status of n events requires O(n) time.
  3. Step 3: Immediate transition (O(1)) is incorrect

    Because multiple events must be verified, O(1) is too optimistic.
  4. Step 4: Logarithmic or quadratic complexities are not typical here

    Priority queues are unrelated; no nested loops cause O(n²).
  5. Final Answer:

    Option A -> Option A
  6. Quick Check:

    Checking all I/O events is linear in number of events [OK]
Quick Trick: Waiting to Ready requires checking all I/O events [OK]
Common Mistakes:
MISTAKES
  • Assuming O(1) for immediate transition
  • Confusing priority queue usage
  • Overestimating complexity as O(n²)
Trap Explanation:
PITFALL
  • Candidates often underestimate the need to check all I/O events, assuming constant time.
Interviewer Note:
CONTEXT
  • Tests understanding of complexity in multi-event synchronization.
Master "Process State Machine - Five-State Model" 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