4.1. 4.1 Shared Variable Pipe

Shared Variable Pipe describes the design of a pipe component of a Parallel Pipes and Filters system that is based on shared variables and asynchronous communication, to implement send and receive operations that emulate the behavior of a pipe component for a shared memory parallel system.

4.1.1. Example

Consider the graphics rendering example used to illustrate the Parallel Pipes and Filters pattern in Section 3.1. A parallel program is developed using the Parallel Pipes and Filters architectural pattern for performing the steps of graphics rendering, which are partitioned among autonomous filters that make up the processing components of the parallel program. The program is to be developed for a shared memory computer, and the programming language available for such a computer uses semaphores [Dij68] [Har98], critical regions [Hoa72] [Bri72] or monitors [Hoa74] [Bri75] [Har98] as synchronization mechanisms for process communication.

Each filter of the parallel program needs to receive data from the previous filter (or source) component and send results to the next filter (or sink) component. Given the way in which Parallel Pipes and Filters describes the structure of the whole parallel application, the communication between filters has to be carried out by pipe components. Consider, for example, the pipe component between the GEN and TRAN filter components of the example (Figure 4.1).

These pipe components should preserve the order of the data ...

Get Patterns for Parallel Software Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.