Which of the following statements about threads is/are TRUE?
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