In any environment, in order to execute a privileged instruction
you have have to switch from user mode to kernel mode, hence a
context switch.
View page
When a context switch occurs, the kernel saves the context of
the old process into its Program Control Block and loads the saved
context of the new process scheduled to run.
View page
If the process that gets the control can be put into the
register (its kept in cache though) means less time to fetch and
have a context switch.
Any way the context switching time isn't a big time delay.
View page
Context switching allows for a computer to multitask. It can
suspend one process in order to switch over and run another
process. The first process can be brought back up by suspending the
second one.
View page
when ever an interrupt occurs, it saves the context of the program being executed & sets the PC to the starting address of the interrupt handling program. now after servicing the interrupt if the same process is resumed which was being interrupted then we will say a context switch has occurred.
But imagine after servicing the interrupt if a new process is to be executed then some more work is required, that is it has to save some more information from the PCB to keep reference to resume its execution and we say process switch has occurred..!!