OSF DCE Application Development Guide--Core Components
Introduction to Multithreaded Programming
certain rooms or performs certain types of work (washing floors, polishing furniture, and
so forth), and each works independently. Figure 6-1 shows a task performed by three
threads in a work crew model.
Figure 6-1. Work Crew Model
Thread A
Thread B
Thread C
(Time)
TASK
Setup Cleanup
6.2.3 Pipelining Model
In the pipelining model, a task is divided into steps. The steps must be performed in
sequence to produce a single instance of the desired output, and the work done in each
step (except for the first and last) is based on the preceding step and is a prerequisite for
the work in the next step. However, the program is designed to produce multiple
instances of the desired output, and the steps are designed to operate in a parallel time
frame so that each step is kept busy.
An example of the pipelining model 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. A
car needs a body before it can be painted, but at any one time numerous cars are
receiving bodies, and then numerous cars are being painted.
In a multithreaded program using the pipelining model, each thread represents a step in
the task. Figure 6-2 shows a task performed by three threads in a pipelining model.
Figure 6-2. Pipelining Model
(Time)
TASK
Thread A Thread B Thread C
124245 Tandem Computers Incorporated 6−3