THE AGC EXECUTIVE SCHEDULER

How a 72 KB machine scheduled its own survival — Apollo Guidance Computer (Q138875), alarm 1201, and the birth of real-time task management

01 / THE MACHINE

The Apollo Guidance Computer — manufactured by Raytheon (Q234276) for NASA's Apollo program — was a 2 MHz, 72 KB core-memory machine running in assembly language. Its software wasn't just guidance code. It contained a fixed-interval cyclic executive — the first production real-time scheduler in flight-critical hardware.

The AGC executive divided tasks across two timer-driven intervals:

PARAMETERVALUEROLE
EXECUTIVE 120 msNavigation, guidance, platform alignment, attitude control
EXECUTIVE 22 msHigh-frequency attitude correction, D-106 loop
PROCESSOR CLOCK2 MHz~4,000,000 cycles/second
MEMORY72 KB (core rope)Read-only; no dynamic allocation
PRIVILEGES5 levels (0–4 + I-level)Preemptive priority with interrupt nesting

Executive 1 ran every 20 milliseconds. Executive 2 ran every 2 milliseconds — ten times per Exec 1 cycle. Together they formed a rigid, deterministic schedule. Not best-effort. Not cooperative. Hard deadlines, every cycle, with priority-based preemption when tasks overran.

This is the same pattern a render farm executive uses today: fixed intervals, task queues, preemptive rescheduling when a node falls behind. The hardware changed. The scheduling topology didn't.

02 / EXECUTIVE STRUCTURE

Each Exec 1 (20 ms) cycle consisted of a table of task descriptors. For each entry, the executive checked a flag: if the task was scheduled for this cycle, it ran the code, updated the flag, and moved to the next entry. When Exec 2 (2 ms) fired, it preempted Exec 1 at the current task boundary, ran its 6 tasks, then resumed Exec 1 exactly where it left off.

[t=0ms] EXEC 1 START → nav_task → platform → display → ... ↓ INTERRUPT (2 ms) EXEC 2 → att_corr_1 → att_corr_2 → d106_loop ↓ RETURN FROM INT [t=2ms] EXEC 1 RESUME → guidance → thrust → ... ↓ INTERRUPT (4 ms) EXEC 2 → att_corr_1 → att_corr_2 → d106_loop [t=4ms] EXEC 1 RESUME → ... × 10 interrupts [t=20ms] EXEC 1 COMPLETE → REPEAT

The key constraint: the sum of all Exec 1 task times must be ≤ 20 ms. The sum of all Exec 2 task times must be ≤ 2 ms. If they weren't, the system couldn't keep its schedule. The designers left headroom — typically running the Exec 1 tasks in ~15-18 of the 20 available ms — so that unexpected loads wouldn't trigger preemption.

When they ran out of headroom, the system dropped the lowest-priority tasks. That's what alarm 1201 was.

03 / ALARM 1201 — THE OVERSCHEDULING EVENT

During Apollo 11's powered descent on July 20, 1969, the AGC threw Alarm 1201 (and later 1202) repeatedly. The alarm codes in the AGC's Display and Keyboard (DSKY) system:

ALARMMEANINGACTION
1201Executive overflow — Exec 1 tasks exceeded 20 ms budgetDrop lowest-priority Exec 1 tasks
1202Executive overflow — Exec 2 tasks exceeded 2 ms budgetDrop lowest-priority Exec 2 tasks

The cause: the rendezvous radar, which should have been powered down before the descent phase, was sending continuous interrupts. Each interrupt forced the AGC to context-switch to a higher-priority I-level task that processed radar data — data the descent didn't need. These spurious interrupts ate cycles from the Exec 1 budget.

The executive responded exactly as designed: it began dropping the lowest-priority tasks in Exec 1's queue to preserve the hard deadline. It was scheduling itself out of a corner.

Gene Kranz at Capstone heard "1201, alert" and asked for the go/no-go. The answer: go. The system was shedding non-essential work to keep the critical path alive. Not a failure. A correct scheduling decision under overload.

Source: Apollo Guidance Computer (Q138875); Apollo 11 (Q43653); source code at github.com/chrislgarry/Apollo-11

04 / THE MATH: THROUGHPUT UNDER OVERLOAD

Map this to the throughput model from render-farm-theory.html. The AGC executive is a single-node scheduler with:

T_available = 20 ms (Exec 1 budget) T_used = Σ t_i (sum of all scheduled task durations) headroom = T_available - T_used When T_used > T_available: → exec drops tasks with lowest priority → T_used ← T_used - t_lowest → repeat until T_used ≤ T_available → ALARM 1201 (flag set)

In the Apollo 11 descent, the radar interrupts pushed T_used above 20 ms. The executive shed tasks until headroom returned to ≥ 0. The throughput equation for the landing trajectory computation remained intact because it was high-priority — it never got dropped. The dropped tasks were display refresh and non-critical calculations.

This is the exact same pattern as capacity-planner.html: when demand exceeds capacity, you shed low-priority work to preserve the critical path. The AGC just did it in 1969 with a wire-rommed executive table instead of a Kubernetes job queue.

05 / COMPARISON: AGC vs. MODERN RTOS

The real-time operating system (Q213666) concept existed in theory before Apollo, but the AGC executive was the first deployed at flight scale. Compare the architectures:

FREQUENCYAGC EXEC 1MODERN RTOS (CYCLONE)
CYCLE20 ms fixedconfigurable 1-100 ms
PRIORITY5 levels (hard-coded)configurable 0-255
PREENPTIONby level onlyby level + FIFO within level
OVERLOADdrop lowest tasks + alarmdrop lowest + configurable policy
MEMORY72 KB, no allocationstatic allocation, bounded

The principles are identical. The difference is that modern RTOSes are parameterized; the AGC was parameterized by hand in the executive tables.

06 / WHY THIS MATTERS

Every render farm scheduler, every real-time pipeline, every task queue is a descendant of the AGC executive. The cyclic executive pattern — fixed intervals, priority-based preemption, deterministic budgeting — is the oldest and most reliable scheduling architecture in flight-critical systems. It survives because it's provably schedulable.

If you're building any system where a missed deadline matters, the AGC executive is still your reference architecture. Sixty years on, no one has improved the basic topology. They've only added more knobs.

RELATED WORK

render-farm-theory.html — throughput equations and the T=N×(F÷S)×3600 model

fault-tree-analysis.html — failure decomposition with SVG gate diagrams

render-farm-calculator.html — interactive capacity calculator

cluster-scaling.html — linear scaling law proof