The time taken to switch between user and kernel modes of execution be...
Process switches or Context switches can occur in only kernel mode . So for process 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 process . At 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 T1< T2
This question is part of UPSC exam. View all Computer Science Engineering (CSE) courses
The time taken to switch between user and kernel modes of execution be...
Relation between time taken to switch between user and kernel modes and between two processes
Explanation:
When a process executes, it switches between user mode and kernel mode. The time taken for this switch is denoted by t1.
When the CPU switches from executing one process to another, it involves context switching which includes saving the state of the current process and loading the state of the next process. The time taken for this switch is denoted by t2.
Now, we need to determine the relation between t1 and t2.
Option A: t1 < />
This option implies that the time taken to switch between user and kernel modes is less than the time taken to switch between two processes. This is not necessarily true. The time taken for context switching includes switching between user and kernel modes, so t2 will always be greater than or equal to t1. Hence, option A is false.
Option B: t1 = t2
This option implies that the time taken to switch between user and kernel modes is equal to the time taken to switch between two processes. This is not true as context switching includes switching between user and kernel modes, as mentioned earlier. Hence, option B is also false.
Option C: t1 > t2
This option implies that the time taken to switch between user and kernel modes is greater than the time taken to switch between two processes. This is true as context switching includes switching between user and kernel modes, and also saving and loading the process state. Hence, option C is the correct answer.
Option D: nothing can be said about the relation between t1 and t2
This option is false as we have established that t2 will always be greater than or equal to t1. Hence, option D is also false.
Conclusion:
The correct option is C, i.e., the time taken to switch between user and kernel modes of execution is greater than the time taken to switch between two processes.