The simplest form of scalable parallelism is a loop of iterations that can each run simultaneously without interfering with each other. The following sections demonstrate how to parallelize simple loops.
Template function parallel_pipeline supports only linear pipelines. It does not directly handle more baroque plumbing, such as in the diagram below.
A user interface thread must remain responsive to user requests, and must not get bogged down in long computations.
Unless otherwise stated, the thread safety rules for the library are as follows:
Two threads can invoke a method or function concurrently on different objects, but not the same object.
It is unsafe for two threads to invoke concurrently methods or functions on the same object.
Template function that performs parallel iteration over a range of values.
The container classes permit multiple threads to simultaneously invoke certain methods on the same container.