# 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.

Source: https://plexiidesk.com/blog/context-switching-explained
Topic: Work by task (https://plexiidesk.com/blog/c/work-by-task)
Author: The Plexii team
Published: 2026-10-20

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](https://plexiidesk.com/blog/context-switching).

[Video: Context switching explained in under a minute](https://plexiidesk.com/blog/media/context-switching-explained.mp4) (54s). An animated explainer: a processor saves its exact place when it switches tasks, a person does not, and the costs of a human switch appear on a timeline

## 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](https://pages.cs.wisc.edu/~remzi/OSTEP/cpu-mechanisms.pdf) 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:

### Diagram: a context switch in a computer, and in a person

| Step | In a computer | In a person |
|---|---|---|
| 1 | Process A is running on the processor. | You are working on task A, holding its details in mind. |
| 2 | A timer interrupt or a system call hands control to the operating system. | A message arrives, or you decide to check something. |
| 3 | **The operating system saves A’s registers, its exact place, to memory.** | **Nothing saves your place. What you were holding starts to fade unless you write it down.** |
| 4 | It restores process B’s registers, and B runs. | You load the rules for task B, while part of your attention stays on A. |
| 5 | Later it restores A’s registers, and A carries on from the exact instruction where it stopped. | Back on A, you rebuild where you were before you can take the next useful step. |
| How long | About 6 microseconds on a 1996 PC, under a microsecond on modern systems. | Tenths of a second to seconds in lab tasks; in real work, often far longer. |

Computer steps and timings: Operating Systems: Three Easy Pieces, chapter 6 (https://pages.cs.wisc.edu/~remzi/OSTEP/cpu-mechanisms.pdf). Lab switch costs: American Psychological Association (https://www.apa.org/topics/research/multitasking) and Altmann and Trafton (2004, https://escholarship.org/uc/item/18b4r661).

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](https://pubmed.ncbi.nlm.nih.gov/12639695/) (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](https://pubmed.ncbi.nlm.nih.gov/11518143/)): "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](https://www.apa.org/topics/research/multitasking) 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?](https://doi.org/10.1016/j.obhdp.2009.04.002). 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](https://web.archive.org/web/20250126022407/https://www.uwb.edu/business/faculty/sophie-leroy/attention-residue)). 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](https://escholarship.org/uc/item/18b4r661) (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:

### Diagram: one task, interrupted

A timeline, not to scale. Task A runs until an interruption; task B runs; then task A resumes. Four costs are marked:

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.

Terms from Monsell (2003, https://pubmed.ncbi.nlm.nih.gov/12639695/), Leroy (2009, https://doi.org/10.1016/j.obhdp.2009.04.002) and Altmann and Trafton (2004, https://escholarship.org/uc/item/18b4r661).

## 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](https://www.fastcompany.com/944128/worker-interrupted-cost-task-switching) 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:

### Self-check: which kind of switch is this?

The web page has a five-question quiz. The scenarios, with answers:

| Scenario | Kind of switch | Why |
|---|---|---|
| At 11:00 you stop work on the budget and start preparing a client presentation, as you planned. | Task switch | You chose to move from one piece of work to another, at a time you decided. |
| To finish one proposal, you move between the document, the pricing spreadsheet and an email thread. | Tool switch | The work stays the same; the app changes. Each move still means finding your place in a different window. |
| You are drafting a report when a chat notification appears, and you reply straight away. | Interruption | Something outside you started the switch, at a time you did not choose. |
| Halfway through a spreadsheet, you wonder whether a parcel has shipped and open the tracking page. | Self-interruption | Nothing called you away. The urge to check came from you, mid-task. |
| A colleague stops at your desk to ask a quick question about another project. | Interruption | Another person started it, and it pulls you into a different piece of work. |

## 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](https://pubmed.ncbi.nlm.nih.gov/19706386/) (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](https://pubmed.ncbi.nlm.nih.gov/11518143/) |
| 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](https://pubmed.ncbi.nlm.nih.gov/12639695/) |
| 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](https://escholarship.org/uc/item/18b4r661) |
| 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](https://www.interruptions.net/literature/Mark-CHI05-p321-mark.pdf) |
| 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](https://ics.uci.edu/~gmark/chi08-mark.pdf) |
| Leroy, 2009 | Performance on a task after leaving another unfinished | Attention stays on the unfinished task and the next task suffers | [DOI](https://doi.org/10.1016/j.obhdp.2009.04.002) |
| 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](https://hbr.org/2022/08/how-much-time-and-energy-do-we-waste-toggling-between-applications) |

Three numbers you will often see need care:

- **"23 minutes to refocus."** Gloria Mark told [Fast Company](https://www.fastcompany.com/944128/worker-interrupted-cost-task-switching) 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](https://www.interruptions.net/literature/Mark-CHI05-p321-mark.pdf)) 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](https://www.apa.org/topics/research/multitasking) 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](https://www.microsoft.com/en-us/worklab/work-trend-index/breaking-down-infinite-workday) (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](https://plexiidesk.com/blog/context-switching#what-a-switch-actually-costs).

## 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.

### Context switching cost estimator

An interactive calculator on the web page multiplies your own numbers: switches between pieces of work a day × minutes to get back into the work each time × working days a week. Worked out for four kinds of day over a five-day week:

| Day | Switches | Minutes each | A day | A week |
|---|---|---|---|---|
| A quiet day | 5 | 1 min | 5 minutes | 25 minutes |
| Our default | 10 | 2 min | 20 minutes | 1 hour 40 minutes |
| A busy day | 20 | 3 min | 1 hour | 5 hours |
| A day of constant interruptions | 40 | 5 min | 3 hours 20 minutes | 16 hours 40 minutes |

The defaults (10 switches a day, 2 minutes to refocus) are our assumptions, not measurements. For context: in lab tasks a single switch costs tenths of a second to a few seconds (APA, https://www.apa.org/topics/research/multitasking; Altmann and Trafton 2004, https://escholarship.org/uc/item/18b4r661); a study of 137 office workers counted nearly 1,200 app and website toggles a day at a little over two seconds each (Harvard Business Review 2022, https://hbr.org/2022/08/how-much-time-and-energy-do-we-waste-toggling-between-applications); observed information workers spent about 11 minutes on one piece of work before switching (Mark, Gonzalez and Harris 2005, https://www.interruptions.net/literature/Mark-CHI05-p321-mark.pdf).

## What reduces context switching

The full set of habits is in our guide to [how to switch less](https://plexiidesk.com/blog/context-switching#switch-less-batch-block-and-decide-in-advance). 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](https://plexiidesk.com/blog/pick-up-where-you-left-off) 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](https://plexiidesk.com/product#desk): one canvas holding its notes, tables, files and browser pages, opened the way you left it. See [Desks, rooms and the canvas](https://plexiidesk.com/help/desk-overview).

Three features are aimed at the moment of coming back:

- The [Where was I widget](https://plexiidesk.com/help/home-widget-where-was-i) 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](https://plexiidesk.com/help/desk-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?](https://plexiidesk.com/help/plexii-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

- [Arpaci-Dusseau and Arpaci-Dusseau: Mechanism: Limited Direct Execution, Operating Systems: Three Easy Pieces, chapter 6](https://pages.cs.wisc.edu/~remzi/OSTEP/cpu-mechanisms.pdf)
- [Rubinstein, Meyer and Evans: Executive control of cognitive processes in task switching (Journal of Experimental Psychology: Human Perception and Performance, 2001)](https://pubmed.ncbi.nlm.nih.gov/11518143/)
- [American Psychological Association: Multitasking: Switching costs (2006)](https://www.apa.org/topics/research/multitasking)
- [Monsell: Task switching (Trends in Cognitive Sciences, 2003)](https://pubmed.ncbi.nlm.nih.gov/12639695/)
- [Altmann and Trafton: Task interruption: resumption lag and the role of cues (Proceedings of the Cognitive Science Society, 2004)](https://escholarship.org/uc/item/18b4r661)
- [Mark, Gonzalez and Harris: No task left behind? Examining the nature of fragmented work (CHI 2005)](https://www.interruptions.net/literature/Mark-CHI05-p321-mark.pdf)
- [Mark, Gudith and Klocke: The cost of interrupted work: more speed and stress (CHI 2008)](https://ics.uci.edu/~gmark/chi08-mark.pdf)
- [Pattison: Worker, interrupted: the cost of task switching, an interview with Gloria Mark (Fast Company, 2008)](https://www.fastcompany.com/944128/worker-interrupted-cost-task-switching)
- [Leroy: Why is it so hard to do my work? The challenge of attention residue when switching between work tasks (Organizational Behavior and Human Decision Processes, 2009)](https://doi.org/10.1016/j.obhdp.2009.04.002)
- [Ophir, Nass and Wagner: Cognitive control in media multitaskers (PNAS, 2009)](https://pubmed.ncbi.nlm.nih.gov/19706386/)
- [Murty, Dadlani and Das: How much time and energy do we waste toggling between applications? (Harvard Business Review, 2022)](https://hbr.org/2022/08/how-much-time-and-energy-do-we-waste-toggling-between-applications)
- [Microsoft WorkLab: Breaking down the infinite workday (2025)](https://www.microsoft.com/en-us/worklab/work-trend-index/breaking-down-infinite-workday)
