The GATE Grind

GATE 2023 CS – Question 22

Operating System · System Calls, Processes, Threads and IPC · 1 mark · Multiple select

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

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) Stack pointer; (C) Program counter; (D) General purpose registers

Explanation

Threads of the same process have separate stacks and register contexts, so the stack pointer, PC and general purpose registers must be saved. They share the address space, so the page table base register need not be saved.