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

2024

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

  1. A.

    Threads can only be implemented in kernel space

  2. B.

    Each thread has its own file descriptor table for open files

  3. C.

    All the threads belonging to a process share a common stack

  4. D.

    Threads belonging to a process are by default not protected from each other

Attempted by 204 students.

Show answer & explanation

Correct answer: D

Correct statement: Threads belonging to a process are by default not protected from each other.

Explanation:

  • Threads can only be implemented in kernel space — False. Threads can be implemented in user space (user-level threads), kernel space (kernel threads), or with hybrid approaches. User-level threads avoid kernel overhead but can be blocked by system calls unless the runtime handles them.

  • Each thread has its own file descriptor table for open files — False. The file descriptor table is typically per-process and shared among all threads of that process, so threads see the same open files.

  • All the threads belonging to a process share a common stack — False. Each thread has its own stack for function calls and local variables; sharing one stack would cause conflicts and corruption.

  • Threads belonging to a process are by default not protected from each other — True. Threads share the same address space (code, heap, globals, file descriptors), so one thread can access or modify memory used by another. Proper synchronization (mutexes, semaphores, atomics) is required to avoid data races.

Key takeaways:

  • Threads share the process address space and most resources.

  • Each thread has its own stack and CPU context (registers).

  • File descriptors are usually per-process and shared by threads.

  • Threads can be implemented in user space, kernel space, or both (hybrid).

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir