Which of the following need not necessarily be saved on a context switch between processes?
GATE CSE 2000Operating System › Process Concepts, Threads & System CallsVerified
GATE CSE 2000 PYQ: Which of the following need not necessarily be saved on a context switch between processes?
- AGeneral purpose registers
- BTranslation look-aside bufferCorrect answer
- CProgram counter
- DAll of the above
Answer
(B) Translation look-aside buffer
Approach
A context switch must preserve exactly the state that is needed to resume the preempted process later as if nothing happened. Anything whose value can be reconstructed or refilled automatically (i.e., pure performance caches) does not have to be part of that saved state. So classify each listed item as 'architectural state' versus 'cached/derived state'.
A context switch saves the architectural state (general purpose registers, program counter, stack pointer, status flags) required to resume the suspended process correctly. The TLB is a hardware translation cache whose entries are tied to a specific process's address space and are simply re-established from the page tables after the switch; saving them is unnecessary. Hence option B is the correct choice.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.