Step 1: Understanding context switch
When switching from one thread (T1) to another (T2) within the same process, the CPU must save the current execution state of T1 and load the execution state of T2.
This execution state primarily consists of CPU registers and pointers required to resume execution later.
Step 2: Evaluating each option
- (A) Page table base register:
All threads of the same process share the same virtual address space, hence the same page table base register.
Therefore, it does not need to be saved or changed during a thread-to-thread context switch.
\(\Rightarrow\) Not required.
- (B) Stack pointer:
Each thread maintains its own stack (for function calls, local variables, return addresses).
To resume T2 correctly, its stack pointer must be restored.
\(\Rightarrow\) Must be saved/restored.
- (C) Program counter:
The program counter (PC) holds the address of the next instruction to execute.
Without saving/restoring the PC, the thread cannot resume from where it left off.
\(\Rightarrow\) Must be saved/restored.
- (D) General purpose registers:
General purpose registers (like AX, BX in x86, or r0, r1 in ARM) hold intermediate data during computation.
Each thread requires its own register values to resume correctly.
\(\Rightarrow\) Must be saved/restored.
Step 3: Conclusion
Only the thread-specific state (stack pointer, program counter, and general registers) needs to be saved/restored.
The address-space-related state (page table base register) remains unchanged because threads of a process share memory.
\[
\boxed{\text{Correct Statements: (B), (C), and (D)}}
\]