Bird
Raised Fist0

A candidate claims that context switching is expensive mainly because it involves copying the entire process memory. What is the flaw in this reasoning?

medium🐞 Bug Identification Q7 of Q15
Operating Systems - Context Switch - Cost & Causes
A candidate claims that context switching is expensive mainly because it involves copying the entire process memory. What is the flaw in this reasoning?
AContext switching does not copy process memory; it only saves CPU state and updates PCB.
BContext switching copies only the stack segment, not the entire memory.
CContext switching copies memory only if the process is swapped out to disk.
DContext switching copies memory only when switching between different user privilege levels.
Step-by-Step Solution
Solution:
  1. Step 1: Clarify what context switch saves

    Context switch saves CPU registers and PCB info; it does not copy process memory.
  2. Step 2: Analyze other options

    Stack copying is not part of context switching. Copying memory occurs during swapping, not context switching. Privilege level changes do not trigger memory copying during context switches.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Context switch saves CPU state, not process memory [OK]
Quick Trick: Context switch saves CPU state, not process memory [OK]
Common Mistakes:
MISTAKES
  • Confusing context switch with swapping
  • Believing stack or memory segments are copied
  • Linking memory copying to privilege changes
Trap Explanation:
PITFALL
  • Candidates often confuse context switching with heavier operations like swapping memory.
Interviewer Note:
CONTEXT
  • Reveals misconceptions about what context switching entails.
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