Skip to content
Official PYQ · 2017

GATE CS 2017 Set 1 Q18 — Processes and Threads

Explain with AI

Threads of a process share

Choose one option
View worked solution

Answer: D

Threads belonging to the same process share the process's address space and resources. Specifically, they share:

  • Code section: The executable instructions.
  • Data section: This contains global variables and static variables.
  • Heap: Dynamically allocated memory (via malloc or new) is shared among all threads of the process.
  • OS resources: Open files, signals, and sockets.

However, each thread maintains its own private copy of:

  • Program Counter (PC)
  • Register set
  • Stack: Used for local variables and function call history.

Since both global variables (data section) and the heap are shared among all threads of a process, the correct option is D.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Processes and Threads questions