TAOCP Vol 1: Fundamental Algorithms · Week 33
TAOCP 1.4.4 Input and Output: reading guide
How MIX overlaps computation with slow I/O using buffers, including double buffering and buffer swapping, and the bookkeeping needed to do that safely.
Time About 4 hours this week
Why it matters
Buffering is still how fast I/O works, from disk reads to network sockets to audio. The ring-buffer patterns here are the same ones you will see in kernel and driver code.
Before you start
- 1.4.1 Subroutines
How to approach it
Draw the buffers as boxes and simulate a few steps of producer and consumer by hand. Do not get hung up on MIX device details.
Exercises
Do the 00 to 15 exercises to make sure you can read MIX fluently. Then write and actually run at least two of the 20-ish programming exercises in a MIX simulator (GNU MDK works). Reading assembly is not the same as writing it; the bugs you hit are the lesson.
Traps
- Getting lost in tape and card-reader specifics. The ideas, not the devices, are the point.