Which of the following statements about threads is/are TRUE?
📖 Explanation
Let's analyze each statement about threads:
(a) Threads can only be implemented in Kernel space: This is FALSE. Threads can be implemented in kernel space (kernel-level threads) or user space (user-level threads), or a hybrid approach.
(b) Each thread has its own file descriptor table for open files: This is FALSE. Threads within the same process share the same file descriptor table, meaning they share open files. Each process has its own file descriptor table, but threads within that process share it.
(c) All the threads belonging to a process share a common stack: This is FALSE. Each thread has its own private stack to store local variables and function call information. While threads share code, data, and open files, their stacks are separate.
(d) Threads belonging to a process are by default not protected from each other: This is TRUE. Threads within the same process share the same address space, including global variables and heap. This shared access means they can directly access and modify each other's data, leading to potential race conditions and requiring explicit synchronization mechanisms (like mutexes or semaphores) for protection.
Therefore, statement (d) is TRUE.