no process control block

The phrase is borrowed. “Context switch” comes from the operating system, where it names the moment the CPU stops running one process and starts running another. On a modern machine it takes a few microseconds.

It’s cheap for one reason. Before the kernel takes a process off the CPU, it writes down everything the process was: program counter, registers, stack pointer, which pages of memory belong to it, what it was waiting on. All of it goes into a structure with a boring name, the process control block, and then the process is gone. Not paused. Gone. When its turn comes back the kernel reads the block, puts every value back where it was, and the process resumes mid-instruction without knowing it ever left.

The switch is cheap because the state is stated.

Now do it with a person. You’re on customer A’s problem, mid-thought, three tabs and a terminal deep, holding in your head who asked, what you tried, what you were about to try, and the one thing you promised to send before five. Customer B calls.

There is no block. Nothing writes your registers down. You put B’s world on, and A’s world doesn’t get saved. It gets dropped, and it stays where it fell, and when you come back you rebuild it from whatever survived. Some of it did. The thing you were about to try usually didn’t.

We took the word from the machine and left the mechanism behind. The machine’s context switch works because someone decided, in the time-sharing days, that a process’s context was a thing you could enumerate and store. Nobody has done that for the person running a dozen processes called customers, projects, a household, and a body.

I’ve written about this before in pieces. Context switching, defined in 2019. Stale. a year later. Always as a cost. It isn’t a cost. It’s a missing data structure.

The kernel’s answer was a block of memory with a fixed shape. Ours can be a page. Who this is for. What’s open. What I tried. What’s next. What I promised. Written before the switch, not after.

What the kernel figured out is that the expensive part of a context switch was never the switching. It’s forgetting to save first.