StreakPeaked· Practice

ExamsGATETechnical

Which one or more of the following need to be saved on a context switch from one thread (T1) of a process to another thread (T2) of the same process?

  1. Page table base register
  2. Stack pointer
  3. Program counter
  4. General purpose registers

Correct answer: Stack pointer

Solution

The stack pointer must be saved during a context switch because it indicates the current position in the stack for the thread, which is essential for maintaining the correct execution state when switching between threads.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →