Skip to main content

GATE CSE 2011Operating System › Process Concepts, Threads & System CallsVerified

GATE CSE 2011 PYQ: Let the time taken to switch from user mode to kernel mode of execution be T 1 T1 T 1 while time taken to…

Let the time taken to switch from user mode to kernel mode of execution be T1T1 while time taken to switch between two user processes be T2T2. Which of the following is correct?

  1. A
    T1>T2T1 > T2
  2. B
    T1=T2T1 = T2
  3. C
    T1<T2T1 < T2
    Correct answer
  4. D
    Nothing can be said about the relation between T1T1 and T2T2

Answer

(C) T 1 < T 2 T1 < T2 T 1 < T 2

Approach

Compare the work performed by a user-to-kernel mode switch with that of a process-to-process context switch. A mode switch mainly changes the CPU privilege level and transfers control to the kernel, whereas switching between two user processes additionally requires saving and restoring process state such as the PCB, registers, and memory-management information.

Switching from user mode to kernel mode is a hardware-supported privilege-level change, while switching between two user processes is a full context switch that also saves and restores process state. Thus the full process switch takes longer, giving T1 &lt; T2.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.