GateAI
Processes, Threads and IPC

GATE CSE 2023 · Q22

MSQ1 markEasy

Time

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?

Select all that applyOne or more correct

Pick every correct option

Solution

Step-by-step verified solution

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

Processes, Threads and IPC

Threads belonging to the same process share common resources, such as:

  • Address space (code, data, and heap segments)

  • Open files and I/O devices

  • Page table / Page table base register (PTBR)

However, each thread maintains its own private execution state, which includes:

  • Program counter (PC): Tracks the next instruction to execute for that thread.

  • Stack pointer (SP): Points to the top of the thread's own execution stack.

  • General purpose registers: Stores active local computation states.

  • State and priority.

When a context switch occurs between two threads T1T_1 and T2T_2 of the same process:

  1. The CPU register set—including the Stack pointer, Program counter, and General purpose registers—must be saved into the Thread Control Block (TCB) of T1T_1 and restored from the TCB of T2T_2.

  2. The Page table base register does not need to be saved or changed because both threads share the identical address space and page tables.

Hence, the correct options are B, C, and D.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Processes, Threads and IPC previous year question is Q22 of the GATE CSE 2023 paper. Find more GATE CSE PYQs on Processes, Threads and IPC in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Processes, Threads and IPC PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Processes, Threads and IPC in GATE CSE

Processes, Threads and IPC has 15 GATE CSE PYQs across 13 papers from 2011 to 2026. 4 of them are 1-mark MSQs like this one, and it is the only one in GATE CSE 2023.

How GATE tests Processes, Threads and IPC

More from GATE CSE 2023

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2023 · Q22 · MSQ

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?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.