Skip to content
Work by task

Context switching explained: from CPU to brain

Context switching explained: what it is, where the term comes from, what happens in your head at each switch, and how to measure your own.

On this page 12 sections

Context switching is moving your attention from one piece of work to another, and rebuilding what you need to know about the new one before you can make progress on it. You do it when you leave a report to answer a message, move from a spreadsheet to a call, or come back to the report afterwards.

This explainer is about the mechanism: where the term comes from, what happens in your head at each switch, the kinds of switch, how it differs from multitasking, and how to measure your own. If you mainly want to switch less, see the real cost of context switching, and how to switch less.

Context switching explained in under a minute

What is context switching?

A context is everything you need in mind to do one piece of work: the goal, the rules you are following, where you got to, and the details you were holding, such as which option you had already ruled out. A context switch is putting one context down and picking another up.

Three things make it more than a change of window:

  • It takes time. Even in simple laboratory tasks, people are slower straight after a switch than when they repeat the same task.
  • It is rarely clean. Part of your attention tends to stay with the work you left.
  • Coming back is a switch too. Returning to the first task means rebuilding its context, and there is usually a delay before your first useful action.

Each of these has a name in the research, and each is explained below.

Where the term comes from: computers first

"Context switch" started as a computing term. A computer's processor runs one program at a time per core, and the operating system shares it between many programs by switching quickly between them.

The textbook Operating Systems: Three Easy Pieces (opens in a new tab) describes it this way: "A context switch is conceptually simple: all the OS has to do is save a few register values for the currently-executing process (onto its kernel stack, for example) and restore a few for the soon-to-be-executing process (from its kernel stack)." The registers hold the program's exact place, down to the next instruction. The same chapter reports a context switch taking "roughly 6 microseconds" on a 200-MHz PC in 1996, and notes that modern systems achieve "sub-microsecond results".

The workplace meaning borrows the phrase. Psychologists, who study the same thing in the laboratory, usually call it task switching. The comparison is useful because of where it breaks down:

A context switch in a computer, and in a person

In a computer

  1. Process A is running on the processor.
  2. A timer interrupt or a system call hands control to the operating system.
  3. The operating system saves A’s registers, its exact place, to memory.
  4. It restores process B’s registers, and B runs.
  5. Later it restores A’s registers, and A carries on from the exact instruction where it stopped.

Exact and complete. About 6 microseconds on a 1996 PC, and under a microsecond on modern systems.

In a person

  1. You are working on task A, holding its details in mind.
  2. A message arrives, or you decide to check something.
  3. Nothing saves your place. What you were holding starts to fade unless you write it down.
  4. You load the rules for task B, while part of your attention stays on A.
  5. Back on A, you rebuild where you were before you can take the next useful step.

Partial and slow. Tenths of a second to seconds in lab tasks; in real work, often far longer.

Computer steps and timings from Operating Systems: Three Easy Pieces, chapter 6 (opens in a new tab). Lab switch costs from the American Psychological Association (opens in a new tab) and Altmann and Trafton (2004) (opens in a new tab).

The key line is step 3. A processor saves its place exactly and completely, every time. A person has no save step. Whatever you were holding in mind starts to fade the moment you turn to something else, unless you write it down. Almost everything that makes human context switching expensive follows from that difference.

What happens in your brain when you switch

Researchers have named three separate costs. They happen at different moments, so it helps to take them in order.

1. Task-set reconfiguration: loading the new rules

Every task comes with a "task set": what to pay attention to, what the rules are, what counts as done. Switching means swapping one set for another.

Stephen Monsell's review Task switching (opens in a new tab) (Trends in Cognitive Sciences, 2003) summarises the laboratory evidence: "Subjects' responses are substantially slower and, usually, more error-prone immediately after a task switch." He adds that this "'switch cost' is reduced, but not eliminated, by an opportunity for preparation", and that it seems to come partly from "time consumed by task-set reconfiguration processes" and partly from the old task's settings carrying over.

Joshua Rubinstein, David Meyer and Jeffrey Evans found the same pattern in four experiments in 2001 (abstract on PubMed (opens in a new tab)): "Task alternation yielded switching-time costs that increased with rule complexity but decreased with task cuing." The American Psychological Association's summary of their work (opens in a new tab) describes two stages: "goal shifting" ("I want to do this now instead of that") and "rule activation" ("I'm turning off the rules for that and turning on the rules for this").

Two practical points follow. Complex work costs more to switch into than simple work, and clear cues about what you are doing make the switch cheaper.

2. Attention residue: the task you left keeps some of you

The second cost runs in the background. In 2009 Sophie Leroy published two experiments in Organizational Behavior and Human Decision Processes, Why is it so hard to do my work? (opens in a new tab). Her abstract states that "people need to stop thinking about one task in order to fully transition their attention and perform well on another", and that "it is difficult for people to transition their attention away from an unfinished task and their subsequent task performance suffers."

She calls this attention residue, which she describes as "when part of our attention is focused on another task instead of being fully devoted to the current task that needs to be performed" (Leroy's own explanation, archived (opens in a new tab)). On the same page she notes that it "easily occurs when we leave tasks unfinished, when we get interrupted, or when we anticipate that once we have a chance to get to the unfinished or pending work we will have to rush to get it done."

3. Resumption lag: finding your place again

The third cost arrives when you come back. Erik Altmann and J. Gregory Trafton, who study interruptions, define it in Task interruption: resumption lag and the role of cues (opens in a new tab) (2004): "The resumption lag is the time interval separating the end of the secondary task and the first subsequent action taken by the human operator in the primary task."

In their task, "The resumption lag (in our task environment) was double the interval between uninterrupted actions (3.8 s vs. 1.9 s)". Those are seconds in a controlled task, not a measure of a working day. The more useful finding is that "cues available immediately before an interruption facilitate performance immediately afterwards (reducing the resumption lag)". In plain terms, leaving yourself a pointer before you switch helps you get back faster.

Here is where the three costs fall on a single interrupted task:

One task, interrupted: where the costs of a switch fall A timeline. Task A runs until an interruption. Task B starts slowly (1, switch cost) while part of your attention stays on task A (2, attention residue). When task B ends there is a gap before the first action on task A (3, resumption lag), and task A then restarts slowly (4, switch cost again). Task A Task B Working on A part of your mind still on A Working on B Back on A Interruption B ends 1 2 3 4 time

Swipe the diagram sideways to see all of it.

  1. Switch cost. The first moments of the new task are slower and more error-prone while your mind loads its rules.
  2. Attention residue. Part of your attention stays on the task you left, most of all when you left it unfinished.
  3. Resumption lag. When you come back, there is a gap before your first useful action while you work out where you were.
  4. Switch cost, again. Picking the first task back up is itself a switch, so it starts slowly too.
Not to scale: the lengths show where each cost falls, not how long it lasts. The terms come from Monsell (2003) (opens in a new tab), Leroy (2009) (opens in a new tab) and Altmann and Trafton (2004) (opens in a new tab).

Types of context switching

Not every switch is the same. Who or what starts it, and whether the task changes or only the tool, makes a difference to what helps.

Type What starts it Example What helps
Task switch You, by plan Stopping the budget at 11:00 to prepare a client presentation Finish to a stopping point and note the next step first
Tool or app switch The work itself Moving between a proposal, the pricing spreadsheet and an email thread Keep everything for one piece of work in one place
Interruption Someone or something else A chat notification, a colleague at your desk, a call Set times when you are reachable; let messages wait in a batch
Self-interruption You, mid-task Opening a tracking page, your inbox or the news without a reason Keep a capture list and write the urge down instead

Self-interruptions are easy to overlook. In an interview with Fast Company (opens in a new tab) in 2008, the researcher Gloria Mark said of the information workers her team observed: "We found people switched these activities on average of every three minutes and five seconds. Roughly half of them are self-interruptions." That is her summary in an interview rather than a figure from a paper, but it matches a common experience: a good share of switching is our own doing.

Try sorting a few everyday moments yourself:

Context switching vs multitasking

The two terms are often used as if they meant the same thing. They describe different patterns.

Context switching Multitasking Task batching
What it is Moving from one task to another, one at a time Trying to do two or more tasks at once Grouping similar small tasks and doing them together
Where your attention goes To one task, then the next, with a cost at each move Back and forth between tasks, rapidly and often without noticing To one kind of work for a set stretch
Example Leaving a report to join a call, then returning Answering chat while following a meeting Replying to all messages at 12:00 and 16:00
Number of switches One per change of task Many, often unnoticed Few, chosen in advance

For most thinking work, what feels like doing two things at once is rapid switching between them, paying the costs above each time. One study of people who often use several media at once, Ophir, Nass and Wagner's Cognitive control in media multitaskers (opens in a new tab) (PNAS, 2009), reported "the surprising result that heavy media multitaskers performed worse on a test of task-switching ability, likely due to reduced ability to filter out interference from the irrelevant task set." The study compared groups of people; it does not show that multitasking caused the difference.

Task batching is the opposite approach. It accepts that some switching is unavoidable and reduces how often it happens.

What the research does and doesn't say about the cost

Popular articles attach precise numbers to context switching, and several are misquoted. Here is what the main studies measured and found.

Study What was measured Finding Source
Rubinstein, Meyer and Evans, 2001 Time to switch between laboratory tasks Switching cost time; more for complex rules, less with cues PubMed (opens in a new tab)
Monsell, 2003 A review of task-switching experiments Slower and usually more error-prone after a switch; preparation reduces but does not remove the cost PubMed (opens in a new tab)
Altmann and Trafton, 2004 Time to the first action after an interruption 3.8 seconds against 1.9 seconds between uninterrupted actions; cues shortened it eScholarship (opens in a new tab)
Mark, Gonzalez and Harris, 2005 Observation of 24 information workers at work About 11 minutes in one working sphere before switching; 57% of working spheres interrupted CHI 2005 paper (opens in a new tab)
Mark, Gudith and Klocke, 2008 Interrupted and uninterrupted email tasks, 48 participants Interrupted people finished faster with no difference in quality, but reported more stress CHI 2008 paper (opens in a new tab)
Leroy, 2009 Performance on a task after leaving another unfinished Attention stays on the unfinished task and the next task suffers DOI (opens in a new tab)
Murty, Dadlani and Das, 2022 App and website toggles of 137 users at three Fortune 500 companies Nearly 1,200 toggles a day, a little over two seconds each: just under four hours a week Harvard Business Review (opens in a new tab)

Three numbers you will often see need care:

  • "23 minutes to refocus." Gloria Mark told Fast Company (opens in a new tab) that "it takes an average of 23 minutes and 15 seconds to get back to the task." That was an interview. Her team's published paper (Mark, Gonzalez and Harris, 2005 (opens in a new tab)) found that "77.2% of interrupted work was resumed on the same day" and that, when it was, it "took an average length of time of 25 min. 26 sec". That is the time before people returned, much of it spent on other work, not 23 minutes of refocusing. The 2008 paper about interrupted work does not contain the figure at all.
  • "Switching costs 40% of your productive time." The APA (opens in a new tab) writes that "Meyer has said that even brief mental blocks created by shifting between tasks can cost as much as 40 percent of someone's productive time." That is an estimate attributed to David Meyer, "as much as", not a measured result of the 2001 study.
  • "Interrupted every two minutes." Microsoft's Breaking down the infinite workday (opens in a new tab) (2025) reports interruptions "every 2 minutes" from Microsoft 365 data. Its notes say this is "Based on the top 20% of users by ping volume received", not the average worker.

What the research supports is the direction rather than one universal number: switches cost time and accuracy, complex work costs more to switch into, unfinished work keeps part of your attention, and good cues reduce the cost. How much it costs you depends on your work, which is why measuring your own is worth doing. For what the cost means in a working week, see the real cost of context switching.

Signs you are context switching too much

None of these is a diagnosis, but together they are a fair hint:

  • You end a busy day with many things started and few finished.
  • You often reread the last paragraph, row or message to remember what you were doing.
  • You open an app and cannot remember why.
  • Your best work happens early, late or at weekends, when nothing interrupts.
  • You keep a tab or window open "so you won't forget", and there are dozens of them.
  • Short gaps between meetings produce almost nothing, because getting into the work takes most of the gap.

How to measure your own context switching

You do not need software for this. Two ordinary days of honest counting tell you more than any average.

  1. Keep a tally. Each time you move from one piece of work to another, make a mark on paper or in a note. Count the switches between pieces of work, not every change of window within the same piece.
  2. Label each one. Was it planned (a task switch), a tool change within the same work, an interruption, or a self-interruption? The labels tell you which fix to try first.
  3. Time a few returns. For three or four switches a day, note when you came back and when you did your first useful thing. That gives you a rough figure for your own resumption lag.
  4. Note what you lost. When you came back, what had you forgotten? That is the context a written note would have saved.

Then put your numbers into the estimator. Change the defaults; they are only a starting point.

What reduces context switching

The full set of habits is in our guide to how to switch less. In short, each one answers one of the costs above:

  • Batch messages and small admin into set times, which reduces interruptions and self-interruptions.
  • Protect a block for your most complex work, because complex rules cost the most to reload.
  • Finish to a stopping point, so less of the task is left unfinished to hold your attention.
  • Leave a note before you switch: where you are and the next step. It is the cue that shortens resumption lag. Our guide to writing a re-entry note has a short format.
  • Keep each piece of work in one place, so coming back is one step rather than a search through several apps.

Where PlexiiDesk fits

The last habit is what PlexiiDesk is built around. In PlexiiDesk each piece of work gets its own desk: one canvas holding its notes, tables, files and browser pages, opened the way you left it. See Desks, rooms and the canvas.

Three features are aimed at the moment of coming back:

  • The Where was I widget on your Home dashboard shows the desk you last worked on, how long ago that was and the last web page you opened, with a Resume button. It needs no AI and is on every plan.
  • Resume on a desk asks Plexii to write a short handoff note: where the work stands, the decisions made, open questions and the next three actions. It is on every plan and needs AI set up, using PlexiiDesk credits or your own Anthropic key.
  • What was I doing? in Plexii's header writes a short summary of your last 30 minutes in PlexiiDesk, ending with where you left off. It is on every plan and uses your own Anthropic key.

None of this stops interruptions. It gives you the save step a processor has and a person lacks: a place where the work, and a note about where you were, wait for you.

Common questions

What is context switching in simple terms? It is moving your attention from one piece of work to another. Each time, you have to load what the new work needs, and when you come back you have to rebuild where you were on the old one.

What does context switching mean in computing? In computing, a context switch is the operating system pausing one process and running another. It saves the first process's register values, which hold its exact place, and restores the next process's. The textbook Operating Systems: Three Easy Pieces reports this taking under a microsecond on modern systems.

Is context switching bad? Not always. Some switching is part of most jobs, and moving to a different task can be the right call. The problem is frequent, unplanned switching on complex work, because each switch costs time, and unfinished work keeps part of your attention.

What is the difference between context switching and multitasking? Context switching is moving from one task to another, one at a time. Multitasking is trying to do several tasks at once. For most thinking work, multitasking turns out to be rapid context switching, with a cost at every switch.

How long does it take to refocus after a context switch? There is no single figure. Lab studies measure a switch in tenths of a second to a few seconds. In a study of real work, people who returned to interrupted work the same day did so after an average of 25 minutes 26 seconds, much of it spent on other work. Your own number depends on your work, so it is worth measuring.

What is attention residue? Attention residue is the part of your attention that stays on a task after you have moved on, most of all when you left it unfinished. The term comes from the researcher Sophie Leroy, whose 2009 experiments found that people perform worse on a new task while their attention is still on an unfinished one.

How can I reduce context switching? Batch messages and small tasks into set times, protect a block for your most complex work, finish to a stopping point before you switch, leave yourself a note with the next step, and keep everything for one piece of work in one place.

Sources

All postsMore in Work by task