GATE CS 2024 Set 1 | Question 24

MSQ · 1 mark

Which of the following statements about threads is/are TRUE?

  1. Option A: Threads can only be implemented in kernel space
  2. Option B: Each thread has its own file descriptor table for open files
  3. Option C: All the threads belonging to a process share a common stack
  4. Option D: Threads belonging to a process are by default not protected from each other (correct)

Answer

(D)

Explanation

  • A: false. Threads can also be implemented in user space by a thread library, with the kernel seeing only one process (the many-to-one model).
  • B: false. Open files belong to the process, so all its threads share one file descriptor table; a file opened by one thread can be used by the others.
  • C: false. Each thread runs its own chain of function calls, so it needs its own stack, along with its own registers and program counter.
  • D: true. The threads of a process share one address space, so any of them can read or overwrite the data of the others. The operating system puts no protection boundary between them; that is the price of cheap sharing.

Answer: D