Bird
Raised Fist0

In a system with multiple CPUs (multi-core), how does context switching overhead differ compared to a single-core system, and what additional factors must be considered?

hard🎤 Interviewer Follow-up Q15 of Q15
Operating Systems - Context Switch - Cost & Causes
In a system with multiple CPUs (multi-core), how does context switching overhead differ compared to a single-core system, and what additional factors must be considered?
AContext switching overhead per CPU remains the same, but inter-CPU cache coherence and synchronization add extra overhead
BContext switching overhead is eliminated because each CPU runs its own process independently
CContext switching overhead doubles because each CPU must save and restore registers twice
DContext switching overhead is reduced because the scheduler can switch processes faster across CPUs
Step-by-Step Solution
  1. Step 1: Per-CPU context switch cost

    Each CPU still saves/restores registers during context switches, so overhead per CPU is similar to single-core.
  2. Step 2: Additional multi-core factors

    Multi-core systems require cache coherence protocols and synchronization mechanisms, adding overhead beyond single-core context switching.
  3. Step 3: Misconceptions

    Context switching is not eliminated; CPUs do not save/restore registers twice per switch; scheduler speedup is not guaranteed.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    Multi-core adds complexity beyond per-CPU context switch overhead.
Quick Trick: Multi-core = same per-CPU cost + extra sync overhead [OK]
Common Mistakes:
MISTAKES
  • Thinking multi-core removes context switch overhead
  • Assuming overhead doubles incorrectly
  • Believing scheduler is always faster on multi-core
Trap Explanation:
PITFALL
  • Options B, C, and D misinterpret multi-core effects on context switching overhead.
Interviewer Note:
CONTEXT
  • Tests advanced understanding of context switching in multi-core environments.
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