CS FundamentalsModerateGATE CS
Assertion (A): User-level thread switching is usually faster than kernel-level thread switching. Reason (R): Switching user-level threads needs no mode switch into the kernel.
- A. Both A and R are true, but R is not the correct explanation of A
- B. A is true but R is false
- C. Both A and R are true, and R is the correct explanation of A
- D. A is false but R is true
Correct answer: C. Both A and R are true, and R is the correct explanation of A
A user-level library can save and restore registers and switch stacks entirely in user mode, avoiding the trap into the kernel that dominates kernel-thread switch cost.
More Operating Systems questions
- A process is in the middle of a system call when a hardware interrupt arrives. Which statement about mode and stacks is correct on a…
- Which of these instructions must be privileged (allowed only in kernel mode) for the OS to keep control? 1. Disable interrupts 2. Read the…
- A process calls read() on a file. Put these in the correct order: (a) the kernel validates arguments and starts I/O; (b) the process…
- Which of the following is TRUE about a zombie process?
- A program has 5% serial code and runs on 16 cores. By Amdahl's law, what is the best speedup possible, and what is the limit as the number…
- A web server creates a new process per request using fork() (copy-on-write). Compared with creating a thread per request, which is the…