Let the time taken to switch from user mode to kernel mode of execution be…

2011

Let the time taken to switch from user mode to kernel mode of execution be \(t1\) while time taken to switch between two user processes be \(t2\). Which of the following is correct?

  1. A.

    \(t1 > t2\)

  2. B.

    \(t1 = t2\)

  3. C.

    \(t1 < t2\)

  4. D.

    Nothing can be said about the relation between \(t1\) and \(t2\)

Attempted by 310 students.

Show answer & explanation

Correct answer: C

Answer: t1 < t2

Explanation: t1 is the time to switch from user mode to kernel mode; t2 is the time to switch between two user processes.

  • User-to-kernel switch (t1): typically involves a trap, interrupt, or system call that changes the CPU privilege level and does limited state saving while remaining in the same process and address space.

  • User-process context switch (t2): requires saving and restoring full CPU registers, switching the address space (page tables), possibly flushing or reloading the TLB, switching kernel stacks, and additional scheduler overhead.

Conclusion: Because a process-to-process context switch performs more and heavier operations than a simple user-to-kernel transition within the same process, the time to enter kernel mode is generally less than the time to switch between two processes, so t1 < t2.

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

Explore the full course: Gate Guidance By Sanchit Sir