Context switching is the process of storing the state of a process or thread, so that it can be restored and resume execution at a later point. This allows multiple processes to share a single CPU, and is an essential feature of a multitasking operating system.
I was just getting in the flow of writing some brilliant code when I got pulled into another meeting - all this context switching is killing my productivity today! You know how it goes, you're deep into optimizing a React component and then Slack pings you about a broken build and you have to do the dreaded context switch to DevOps troubleshooting mode.
Context switching is an essential concept in operating systems and concurrency. Learn more about how it works under the hood in this deep dive: Context Switch Definition
Excessive context switching is a major productivity killer for developers. This article explores some strategies to minimize it: Context Switching: Why It's So Hard to Avoid & How to Prevent It Anyway
Context switching is also highly relevant in front-end development when managing UI state. This article digs into some patterns for dealing with it effectively in React apps: 5 Types Of Application State, Illustrated With React
Note: the Developer Dictionary is in Beta. Please direct feedback to skye@statsig.com.