Run CODE0 and something quietly remarkable happens: an infinite loop stops. CODE1 writes the character CODE2 forever, CODE3 reads three lines and exits, and then CODE4 — a program with no timeout, no cancellation token, and no knowledge that CODE5 exists — dies within microseconds. Engineers type CODE6 a hundred times a day, but few can answer the question what is a Unix pipe at the level of the kernel object rather than the shell metaphor. The answer is worth having, because a pipe is not one mechanism. It is three fused into a single primitive: a bounded buffer, a blocking write that implements backpressure, and a cancellation signal that propagates backwards, from consumer to producer.
Almost every in-process streaming library written since 1973 implements one or two of those three. The pipe has had all three since a night in the early 1970s, in roughly two hundred lines of C, on a machine with 64 KiB of address space.

The Three Mechanisms Inside One Primitive
Start with the demo, because it contains the whole article.