Chapter 15

Pipelining Threads

Abstract

The subject of this chapter is control parallelism: threads acting successively on the same data target. The pipeline parallel pattern as well as the various ways of synchronizing the cooperating threads are discussed in detail. The synchronization mechanisms are first illustrated by an image treatment example in which the image construction is pipelined. Next, some utility classes are introduced to simplify the implementation of synchronization patterns, and the pipeline pattern is used to reexamine the data dependency problem from the previous chapter. Various versions of the two preceding applications—using the OpenMP and vath environments—are proposed. Finally, the TBB pipeline class is discussed ...

Get Shared Memory Application Programming 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.