Question:medium

Which one of the following is not necessarily saved on a context switch between two processes?

Show Hint

Only process-specific CPU state is saved during context switching, not hardware cache contents like the TLB.
Updated On: Jul 6, 2026
  • General purpose registers
  • Translation look-aside buffer
  • Program counter
  • Stack pointer
Show Solution

The Correct Option is B

Approach Solution - 1

Registers, the program counter, and the stack pointer are all part of what actually defines "where a process is" and "what it was working on", losing any of these would make it impossible to resume the process correctly, so they must always be saved.
The TLB is different, it's a cache used purely to speed up virtual-to-physical address translation, it doesn't hold anything about the process's own logic or data. Losing it doesn't corrupt the process, it just means the next few memory accesses are a bit slower until the cache refills.
So the correct answer is Translation look-aside buffer.
Was this answer helpful?
0
Show Solution

Approach Solution -2

Another way to sort this out is by asking whether each item belongs to the process control block (the record of a specific process) or to shared hardware machinery that exists independent of any one process:

  1. General purpose registers: Directly hold a specific process's live computation, these values belong to that process alone and are stored in its process control block on a switch.
  2. Translation look-aside buffer: A shared piece of CPU hardware that caches recent address translations for whichever process happens to be running, it isn't tied to one process's identity, so it isn't part of any process's saved control block.
  3. Program counter: Points to the exact next instruction for a specific process, this value is meaningless for any other process and must be saved in that process's control block.
  4. Stack pointer: Points into a specific process's own stack memory, again something unique to that process that must be recorded.

Three of the four are inherently tied to a specific process's identity and must travel with it; the TLB is shared hardware infrastructure, not process-specific state.

Therefore, the correct answer is Translation look-aside buffer.

Was this answer helpful?
0