Let the time taken to switch from user mode to kernel mode of execution be while time taken to switch between two user processes be . Which of the following is correct?
View worked solution
Answer: C
To compare the two times, let's analyze what happens during each switch:
- Mode Switch (): This occurs when a user process makes a system call, or when an interrupt/exception is raised. The CPU switches its execution privilege level from user mode to kernel mode within the context of the same process. Only a minimal state (such as the Program Counter, Stack Pointer, and Processor Status Word) is saved onto the kernel stack. No change of address space is required, making this a very lightweight operation.
- Process Switch (): This is a full context switch between two different user processes. It requires saving the entire CPU state of the current process into its Process Control Block (PCB), running the scheduler to select the next process, and switching the memory address space (updating the page table base register, which typically flushes the Translation Lookaside Buffer (TLB)). Finally, the state of the new process is loaded.
Since a process switch () involves significant memory management and scheduling overhead in addition to mode switching, it is much more time-consuming than a simple mode switch ().
Therefore, .
Free practice · Your answers on this page are not saved.
