#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::1.4.4 Input and Output
#columns:Front	Back	Tags
TAOCP §1.4.4 Input and Output: what does it cover?	How MIX overlaps computation with slow I/O using buffers, including double buffering and buffer swapping, and the bookkeeping needed to do that safely.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::about
TAOCP §1.4.4: why does it matter?	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.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::why
TAOCP §1.4.4, a common trap: “Getting lost in tape and card-reader specifics.” What's the catch?	The ideas, not the devices, are the point.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::trap
TAOCP §1.4.4, exercise 1 (rated 05): what is it asking?	Check whether reordering the moves and the busy wait breaks buffered input.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4, exercise 3 (rated 22, recommended): what is it asking?	Write the buffer-swapping output routine, the mirror image of the input one.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4, exercise 6 (rated 12): what is it asking?	Set up the input routine so it gets off to the right start. Initialization is where buffering code breaks.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4, exercise 9 (rated 21, recommended): what is it asking?	Simulate a buffer timeline from a list of compute and I/O times.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4, exercise 14 (rated 20, recommended): what is it asking?	What happens when a program grabs two buffers before releasing either.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4, exercise 15 (rated 22, recommended): what is it asking?	Write a complete tape copy program with three buffers, as fast as possible.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4, exercise 5 (rated M21, recommended): what is it asking?	Bound how much buffering can speed up a program that uses several devices.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4, exercise 18 (rated 30, recommended): what is it asking?	Rework the buffering algorithms for a MIX with interrupts. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercise
TAOCP §1.4.4: how many exercises, and how are they rated?	19 exercises, rated 05 to 40.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::exercises
TAOCP §1.4.4: what should you be comfortable with first?	<ul><li>1.4.1 Subroutines</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::prereqs
TAOCP §1.4.4: how should you work through 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.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.4.4 cracked.guide::kind::approach
