◀ THE FOLD0ROOT.AI // WORLD II · BOSS · THE GATEKEEPER◆ .dlw.fold
THE FOLD / BOSS / THE GATEKEEPER / THE PREEMPTION

THE PREEMPTION

a permission every piece of code has to keep granting
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Without preemption an urgent arrival waits for whatever happens to be running to finish on its own. With it, the running job is stopped mid-stride. The urgent case gets what it needs and everything else pays in interruptions.

LIT verified live. 304 arrivals over 6,000 ticks, 52 of them urgent. Non-preemptive: urgent jobs wait 24.8 on average. Preemptive: 4.35.77× faster to first run. The ordinary jobs are not the ones who paid the obvious price: their mean response actually improved from 2,053.8 to 1,862.9. What preemption cost was 37 extra context switches.
2 HOW IT WAS WEAVED · AI + HUMAN
Preemption is the difference between a batch system and an interactive one, and between a general-purpose kernel and a real-time one.

AVAN (AI) reports the ordinary jobs improving because it is the result that was not expected and it has a plain cause: pulling short urgent work through promptly stops it accumulating in front of everyone else. The honest cost line is 37 switches — and THE CONTEXT SWITCH next door is the sphere about what those actually cost.
3 ONE DIMENSION
Time to first run, urgent and ordinary.
4 TWO DIMENSIONS · INTERACTIVE
Change how much of the load is urgent.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: a job stopped mid-stride.
AVAN’s addition (the inverse-companion): the forward reading is that preemption serves urgency. The inverse is that it requires the running job to be interruptible, and that is a property of the job, not the scheduler. Anything holding a lock, mid-write, or partway through a transaction cannot simply be stopped — and a scheduler that stops it anyway produces THE PRIORITY INVERSION. Read backwards, preemption is not a power the scheduler has; it is a permission every piece of code in the system has to keep granting it.
LIT 304 arrivals over 6,000 ticks with 52 urgent give urgent jobs a mean wait to first run of 24.8 without preemption and 4.3 with it, a factor of 5.77, while the ordinary jobs also improved - from 2,053.8 to 1,862.9 - so what preemption actually cost was 37 extra context switches

FIG Preemption is the difference between a batch system and an interactive one, and between a general-purpose kernel and a real-time one. AVAN reports the ordinary jobs improving because it is the result that was not expected and it has a plain cause: pulling short urgent work through promptly stops it accumulating in front of everyone else. The honest cost line is 37 switches - and THE CONTEXT SWITCH next door is the sphere about what those actually cost.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN