A context switch is the computing process in of storing and restoring the state of a CPU (the context) such that multiple processes can share a single CPU resource. The context switch is an essential feature of a multitasking operating system. |
A context switch is the computing process of storing and restoring the state of a CPU (the context) such that multiple processes can share a single CPU resource. The context switch is an essential feature of a multitasking operating system. |
Context switches usually involve the following steps, assuming process P1 is running on the CPU and process P2 is the next process to run on the CPU:
Some CPUs contain logic to allow several hardware contexts to simultaneously exist, eliminating the need to store and restore the CPU context to memory on context switch.