Which of the following is/are shared by all the threads in a process? I.…

2017

Which of the following is/are shared by all the threads in a process?

I.    Program counter

II.    Stack

III.    Address space

IV.    Registers

  1. A.

    (I) and (II) only

  2. B.

    (III) only

  3. C.

    (IV) only

  4. D.

    (III) and (IV) only

Attempted by 254 students.

Show answer & explanation

Correct answer: B

Answer: Only the process address space is shared by all threads.

Explanation:

  • Shared by all threads: the process address space (code segment, global/static data, and heap). This allows threads to access the same memory and share data structures.

  • Private to each thread: program counter, stack, and registers. These store the thread's execution state so threads can run independently at different points in the code.

Therefore, the correct choice is the one that states only the address space is shared.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir