%% date:: [[2021-08-15]], [[2024-01-18]] parent:: %% # [[Context-switching]] Context-switching is the instance of dropping an unfinished task in the middle of doing it and picking up another task. ## Context switching in computing In computing, preemption is when a higher-priority task preempts, or interrupts and takes precedence over, another task that is already running. There is also the concept of [[Dimming]] or burnout from [[Site Reliability Engineering|Site Reliability Engineering]], where incoming requests or traffic are preemptively and intentionally refused in response to a high load that might otherwise lead to worse outcomes for the application. In this situation, context-switching allows an application to shift in real time in response to the situation. A large part of Brownout Theory involves determining _how_ to context switch; that is, how to distinguish between required and optional requests.