CS FundamentalsModerateGATE CS

Which items are shared by all threads of one process? 1. Heap 2. Stack 3. Open file descriptors 4. Program counter 5. Global variables

  1. A. 1, 2, 3 and 5
  2. B. 1, 3 and 5 only
  3. C. 1 and 5 only
  4. D. All five

Correct answer: B. 1, 3 and 5 only

Threads share the address space (code, globals, heap) and OS resources such as open files. Each thread has its own stack, registers and program counter.

More Operating Systems questions

Exams that ask this topic