Week 33 of 125

TAOCP 1.4.4 and 1.4.5

Sign up or sign in to tick these off and give this week a due date.

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

    Reading guide

  • A short history of subroutines, coroutines, interpreters and related ideas, with pointers to the original papers.

    Time About 1 hour this week

    Why it matters

    Knowing where ideas came from helps you see that today's "new" patterns are often old. It is also a breather after a heavy chapter.

    Before you start

    • 1.4.1 to 1.4.4

    How to approach it

    Read it with a coffee. Then spend your remaining time on chapter 1 exercises you skipped.

    Exercises

    History sections usually have few or no exercises. Use the week to go back to one earlier exercise you gave up on and finish it.

    Reading guide

  • Two problems from the NeetCode 150, in order. One box for the pair.