what is the difference between context switch and preemption?
Preemption is the act of interrupting a process without its involvement. ... A context switch is what happens when the OS code (running preemptively) alters the state of the processor (the registers, mode, and stack) between one process or thread's context and another.