Question
Let the time taken to switch between user and kernel modes of execution be while the time taken to switch between two processes be . Which of the following is TRUE?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2011 answer key
Solution
Compare the operations required for a mode switch versus a full process context switch.
- A mode switch () occurs when execution transitions between user mode and kernel mode (for instance, during a system call or hardware interrupt). The processor saves only the essential architectural registers (such as program counter and status register) and switches the execution privilege level, while retaining the same virtual address space without flushing TLB entries.
- A process context switch () occurs when the operating system switches execution from one process to a completely different process. This requires saving all CPU registers to the outgoing Process Control Block (PCB), loading the incoming process PCB, switching page tables (modifying the page table base register CR3), invalidating non-global TLB entries, and running scheduling algorithms.
- Because a process context switch includes a mode switch plus complete address space and state replacement, it strictly takes more time than a simple mode switch: .
Final answer
C
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2011 Computer Science and Information Technology (CS)
- Question
- 6 of 65, printed as CS Q.6
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.