Question:

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
collegedunia
Verified By Collegedunia

The Correct Option is B

Approach Solution - 1

Step 1: Understanding context switching.
A context switch occurs when the CPU switches from executing one process to another. To resume execution later, the state of the current process must be saved.
Step 2: Identifying what must be saved.
The CPU state includes the program counter, stack pointer, and general-purpose registers, as these are essential to resume the process correctly.
Step 3: Role of the Translation Look-aside Buffer (TLB).
The TLB is a hardware cache used to speed up virtual-to-physical address translation. Its contents are not part of the process state and are often flushed or overwritten during a context switch.
Step 4: Final conclusion.
Therefore, the Translation Look-aside Buffer is not necessarily saved during a context switch.
Was this answer helpful?
0
0
Show Solution
collegedunia
Verified By Collegedunia

Approach Solution -2

A context switch must preserve everything needed to correctly resume a process later. Let's check what each item represents and whether it must be part of that saved state:

  1. General purpose registers: These hold the values a process was actively computing with, if they weren't saved, the process would lose its working data and could not resume correctly. They must be saved.
  2. Translation look-aside buffer (TLB): The TLB is a hardware cache that speeds up address translation lookups; it isn't part of a process's logical state; it's just a performance optimization. On a context switch it's often simply flushed (or tagged) rather than saved and restored, since the incoming process can just repopulate it as it runs, so it doesn't need to be preserved for correctness.
  3. Program counter: This records exactly which instruction to resume from, without saving it the process couldn't continue where it left off. It must be saved.
  4. Stack pointer: This records where the process's function call stack currently is, without it, local variables and return addresses would become inaccessible or corrupted. It must be saved.

Three of these are essential to correctly resuming the exact process state; the fourth is just a speed optimization that can be safely discarded and rebuilt.

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

Was this answer helpful?
0
0