Mon Nov 13 10:15:16 EST 2017

In C: buffers are actually just state machines

When you find yourself writing to a buffer, what you are actually
doing is writing "into the reader" of a state machine.

Conversely, reading from a buffer is really just reading from the
writer of another state machine.

The big lesson is that it really doesn't matter when code runs, only
that it runs in time to produce the right data.