AMU 2026 — Computer PYQ
AMU | Computer | 2026Which of the following is/are shared by all the threads in a process?
I. program counter
II. stack
III. address space
IV. registers
Choose the correct answer:
- A.
I and II
- B.
III only
(Correct Answer) - C.
IV only
- D.
III and IV
III only
Explanation
Threads are lightweight execution units within a single process. They share the global resources of the process but maintain individual execution states:
Shared Components among Threads:
Address Space (Statement III): All threads of a process share the exact same virtual address space, which includes the text segment (code), data segment (global and static variables), and heap memory.
Open Files / Handles: File descriptors opened by one thread can be accessed by any other thread in that process.
Private Components (Not Shared):
Program Counter (Statement I): Each thread executes a distinct path of instructions independently, requiring its own Program Counter (PC) to track the current instruction.
Stack (Statement II): Each thread executes functions independently, requiring its own private call stack to store local variables, parameters, and function return addresses.
Registers (Statement IV): Each thread has its own register state representing the working state of the CPU while it is executing.
Therefore, out of the given choices, only the address space (III) is shared by all the threads in a process.
