GATE 2023 CS – Question 22
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?
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.