Context Switching
Updated 2026-07-30
Summary
Context switching, also known as environment switching, is a computer term referring to the process of storing and restoring the state (context) of a CPU so that multiple processes can share a single CPU resource. To switch processes on the CPU, the current process's state must be saved, and the state of the process to be executed must be loaded back into the CPU.
Definition
When the CPU switches from one task to another, it must save the current task's state and load the new task's state. This process has overhead (time, computational power). Scaffolding role: The hidden cost of multitasking. Don't assume that 'doing two things at once' is efficient. Frequent switching causes the brain to expend a large amount of energy on 'saving/loading' rather than on the task itself. Maintaining long periods of single-threaded work (flow) is the only solution to reduce switching overhead.
Introduction
How to use
The hidden cost of multitasking. Don't assume that 'doing two things at once' is efficient. Frequent switching causes the brain to expend a large amount of energy on 'saving/loading' rather than on the task itself. Maintaining long periods of single-threaded work (flow) is the only solution to reduce switching overhead.
Mechanism
Task switching requires 'saving the scene—loading the scene', and this overhead does not produce value but inevitably occurs. When switching frequency is high, the overhead proportion approaches or even exceeds effective working time (analogy: loading/unloading time exceeds driving time). The same applies to the human brain: each switch requires reloading goals, constraints, and intermediate states, and it takes time to regain focus. Therefore, 'parallel' is actually 'fast serial + high loss'.
Practice
In progress 0/5Practice this model in one real situation:
Cases
- - Work: Writing a report while replying to messages degrades both report quality and speed; efficiency recovers after switching to centralized message replies. - Programming: Frequently jumping between multiple bugs, each requiring re-reading code, is extremely inefficient. - Life: Scrolling through your phone while cooking, missing the heat level.
Common pitfalls
- - Thinking 'multitasking' increases productivity, but it actually increases errors and time. - Using more tools to manage switching, which creates more switching. - Ignoring the time cost of regaining focus.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E4%B8%8A%E4%B8%8B%E6%96%87%E4%BA%A4%E6%8F%9Bverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.