PrevUpHomeNext

Design Rationale

The interface of Pipeline is based on the N3534 proposal which offers a way to emulate UNIX pipelines. The point of pipelines is to describe the processing of the input as a series of transformations. Transformations are connected and can operate parallel.

Using such pipelines is beneficial also in the C++ programming environment. Advantages of a pipeline based solution include:

  1. Stand alone transformations are easier to design, test and reason about because of decoupling.
  2. It's trivial to run independent transformations parallel and thus leverage multiple execution agent.
  3. Because of separation, race conditions and deadlocks are less likely to happen.
  4. By fine tuning scheduling parameters it's possible to achieve desirable throughput/latency balance.

This library implements all of the abstractions and operations of the N3534 proposal except the parallel() function. The parallel() function is yet missing but soon to be implemented. The next step is to provide a coroutine/fiber based execution scheme to improve on the classic thread-based scheduling.

There is a reference implementation of the original proposal. The Boost.Pipeline is different in some ways. The most important points are:

  1. Boost.Pipeline is C++11 only, because it makes the code cleaner and easier to understand. Probably when the library is stable, C++11 will be a default, at least for new projects, if it's not already.
  2. Thanks to C++11 features, Boost.Pipeline supports a wide variety of transformations: function pointers, functors, function objects, lambdas and bind expressions. The reference implementation does not seem to accept the last three. [1]
  3. Boost.Pipeline takes advantage of value semantics wherever it's possible and avoids use of dynamic memory. E.g: Connecting two segments results in a new segment type, the type of a plan encodes all the contained segments. The reference implementation, on the other hand, uses dynamic memory and type erasure excessively.


[1] Because of broken tests, it's hard to tell.


PrevUpHomeNext