Bird
Raised Fist0

When a timer interrupt triggers a context switch, what is the correct sequence of events that occur internally before the next process runs?

easy🧠🧾 Concept Trace Q12 of Q15
Operating Systems - Context Switch - Cost & Causes
When a timer interrupt triggers a context switch, what is the correct sequence of events that occur internally before the next process runs?
AScheduler selects next process -> Save current CPU registers -> Load next process PCB registers -> Resume execution
BSave current CPU registers to PCB -> Load next process PCB registers -> Scheduler selects next process -> Resume execution
CSave current CPU registers to PCB -> Scheduler selects next process -> Load next process PCB registers -> Resume execution
DLoad next process PCB registers -> Save current CPU registers -> Scheduler selects next process -> Resume execution
Step-by-Step Solution
  1. Step 1: Save current process state

    Before switching, CPU registers of the current process must be saved to its PCB.
  2. Step 2: Scheduler decision

    After saving, the scheduler selects the next process to run.
  3. Step 3: Load next process state

    The CPU registers of the selected process are loaded from its PCB.
  4. Step 4: Resume execution

    The CPU resumes execution with the new process context.
  5. Final Answer:

    Option C -> Option C
  6. Quick Check:

    Saving registers before scheduler decision and loading registers after is the correct order.
Quick Trick: Save first, then schedule, then load -> context switch order [OK]
Common Mistakes:
MISTAKES
  • Selecting next process before saving current registers
  • Loading next process registers before scheduler decision
  • Mixing order of save/load and scheduling
Trap Explanation:
PITFALL
  • Scheduler cannot select next process before current state is saved; loading registers before scheduling is illogical.
Interviewer Note:
CONTEXT
  • Tests understanding of the internal sequence during context switching.
Master "Context Switch - Cost & Causes" 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