Bird
Raised Fist0

Why does increasing the frequency of context switches beyond a certain point degrade overall system performance?

medium🪤 Complexity Trap Q13 of Q15
Operating Systems - Context Switch - Cost & Causes
Why does increasing the frequency of context switches beyond a certain point degrade overall system performance?
ABecause saving and restoring CPU registers is a costly operation that consumes CPU cycles
BBecause the scheduler runs out of processes to schedule
CBecause the MMU has to reload page tables more frequently
DBecause the CPU cache is flushed automatically on every context switch
Step-by-Step Solution
  1. Step 1: Identify overhead of context switch

    Saving/restoring CPU registers and PCB updates consume CPU time, causing overhead.
  2. Step 2: Scheduler availability

    The scheduler can always select processes; running out is not a cause of performance degradation.
  3. Step 3: MMU and page tables

    MMU page table reloads happen on address space switches, but not necessarily on every context switch.
  4. Step 4: CPU cache behavior

    CPU cache is not flushed automatically on every context switch; cache invalidation is more complex.
  5. Final Answer:

    Option A -> Option A
  6. Quick Check:

    Context switch overhead is mainly CPU cycles spent saving/restoring registers.
Quick Trick: More switches -> more register save/restore overhead -> slower system [OK]
Common Mistakes:
MISTAKES
  • Believing scheduler runs out of processes
  • Assuming MMU reloads page tables every switch
  • Thinking CPU cache flushes on every context switch
Trap Explanation:
PITFALL
  • Options B, C, and D are plausible but incorrect causes of performance degradation due to context switching.
Interviewer Note:
CONTEXT
  • Tests understanding of the cost and trade-offs of context switching frequency.
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