The GATE Grind

GATE 2017 CS – Question 28

Operating System · System Calls, Processes, Threads and IPC · 1 mark · Multiple choice

Threads of a process share

  1. global variables but not heap.
  2. heap but not global variables.
  3. neither global variables nor heap.
  4. both heap and global variables.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) both heap and global variables.

Explanation

Threads of one process run in the same address space, so they share the global variables and the heap. Each thread has its own stack and registers.