A thread is usually defined as a "light weight process" because an Operating System (OS) maintains smaller data structure for a thread than for a process. In relation to this, which of the following statement is TRUE?
View worked solution
Answer: C
To determine the correct statement, let us look at what is shared among threads of the same process and what is maintained uniquely for each thread (on a per-thread basis):
- Shared resources (Process level): Address space (virtual memory state), global variables, code segment, data segment, open file descriptors, and signals.
- Private resources (Per-thread level): Thread ID, Program Counter (PC), CPU register state, Stack (for local variables and function call history), and thread-specific state/priority.
Now let us evaluate the given options:
- Option A is incorrect: The OS maintains more than just the CPU register state per thread, such as the thread's private stack, program counter, and thread ID.
- Option B is incorrect: Each thread must have its own separate execution stack to store local variables and track active function calls.
- Option C is correct: Virtual memory state (including page tables and address space) is maintained at the process level. All threads belonging to the same process share this virtual memory state, so the OS does not maintain a separate virtual memory state on a per-thread basis.
- Option D is incorrect: The OS maintains registers, stack, and program counter in addition to scheduling information for each thread.
Free practice · Your answers on this page are not saved.
