ContextSwitching.md (580B)
1 # Context Switching 2 3 **Source:** CS 6200 4 5 **Chapter:** P2L1 6 7 **Definition:** Context switching is the process by which the OS switches between the execution of two different processes. 8 9 Context switching is done by interrupting the currently executing process, writing its registers to the process's [PCB](ProcessControlBlock.md), and then loading the saved register values from the other process's PCB into the registers. 10 11 This operation can be expensive because there are direct costs, like loading / unloading instructions, and indirect costs like cold cache and cache misses.