In the pipelining model, a task is divided vertically into steps. The steps must be performed in sequence to produce a single instance of the desired result, and the work done in each step (except for the first and last) is based on the previous step and is a prerequisite for the work in the next step. However, the program is designed to produce multiple instances of the desired result, and the steps are designed to operate in parallel so that while one step is performed on one instance of the result, the preceding step can be performed on the next instance of the result.
An example of the pipelining model in a factory environment is an automobile assembly line. Each step or stage in the assembly line is continually busy receiving the product of the previous stage's work, performing its assigned work, and passing the product along to the next stage.
In a multithreaded program using the pipelining model, each thread executes a step in the task. Figure 1-5 shows a task performed by three threads in a pipelining model.