Previous year gate question


The time taken to switch between user and kernel modes of execution be t1 while the time taken to switch between two processes be t2. Which of the following is TRUE?


(A) t1 > t2
(B) t1 = t2
© t1 < t2
(D) nothing can be said about the relation between t1 and t2.


When you switch processes, you have to do a context switch, save the PCB of previous process, then save registers and then load the PCB of new process and load its registers etc.
When you switch between kernel and user mode of execution, OS has to just change a single bit at hardware level which is very fast operation.
Hence ,time taken to switch two processes is very large as compared to time taken to switch between kernel and user mode of execution.
answer : C


process switches or context switches can occur only in kernel for the proces switches first we have to move from user to kernel mode.then we have to save the PCB of the process from which we are taking off CPU and then we have to load PCB of the required switching from kernel to user mode is done .but switching from user to kernel mode is a very fast operation(OS has to just change single bit at hardware level)

thus option © T1<T2 is correct.