Threads of a process share
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2017 Set 1 · Q18
Time
Select one answerSingle correct
Solution
Official answer: D) both heap and global variables.
Processes, Threads and IPCThreads belonging to the same process share the process's address space and resources, which include:
Code segment (text)
Data segment (global and static variables)
Heap (dynamically allocated memory)
Open files and OS resources
Each thread maintains its own private:
Thread ID
Program counter (PC)
Register set
Stack (for local variables and function calls)
Therefore, threads share both heap and global variables, making (D) the correct option.
Try the question first, then check your work.
Examiner trap
Consider what memory segments are private to each thread (e.g., registers, stack) versus what segments belong to the process as a whole.
This Processes, Threads and IPC previous year question is Q18 of the GATE CSE 2017 Set 1 paper. Find more GATE CSE PYQs on Processes, Threads and IPC in Operating Systems, or browse all GATE CSE PYQs.
Free diagnostic
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.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Processes, Threads and IPC has 15 GATE CSE PYQs across 13 papers from 2011 to 2026. 7 of them are 1-mark MCQs like this one, and it is the only one in GATE CSE 2017 Set 1.
How GATE tests Processes, Threads and IPCIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.