Imagine an assembly line: one worker washes, another dries, and a third folds. Each worker handles a separate stage, so several loads can move through the process at once. Pipeline processing divides an algorithm into consecutive stages and passes each result to the next stage. section 7.3
The pattern improves overlap rather than making one item finish sooner. While one stage processes one portion, earlier stages can begin the next portion and later stages can finish the previous one. Different cores or workers can own different stages, with communication between them. section 7.3
A useful pipeline has these characteristics:
- It decomposes the algorithm into separate, consecutive steps. section 7.3
- It passes each completed result to the next stage while accepting new input. section 7.3
- It relies on independent work and shared resources, so locks or other coordination may be needed. section 7.0 section 7.3
- It can leave resources idle when stages are unbalanced or when work cannot overlap. section 7.3
Four loads of laundry
Without pipelining, washing, drying, and folding happen in long sequential stretches, leaving the washer or dryer idle. With three workers—washer, dryer, and folder—the first load moves to drying while the second starts washing. A Python version models each stage with a thread and connects stages with queues; its output shows multiple loads progressing simultaneously before reporting that all work is done. section 7.3















































