Classes critical_section and reader_writer_lock exist for compatibility with the Microsoft Parallel Patterns Library (PPL). They do not follow all of the conventions of other mutexes in Intel® Threading Building Blocks.
Intel® Threading Building Blocks (Intel® TBB) provides a task scheduler, which is the engine that drives the algorithm templates and task groups. You may also call it directly. Using tasks is often simpler and more efficient than using threads, because the task scheduler takes care of a lot of details.
Subclass of task that represents doing nothing.
Namespace this_thread contains global functions related to threading.
A Community Preview feature may be defined completely in header files or it may require some additional support defined in a library.
For a CP feature that is contained completely in header files, a feature-specific macro must be defined before inclusion of the header files.
#define TBB_PREVIEW_FOO 1 #include "tbb/foo.h"
If a CP feature requires support from a library, then an additional library must be linked with the application.
template<typename handler_type> class aggregator_ext;
#define TBB_PREVIEW_AGGREGATOR 1 #include "tbb/aggregator.h"
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.
Intel® Threading Building Blocks (Intel® TBB) components are defined in namespace tbb. For brevity’s sake, the namespace is explicit in the first mention of a component, but implicit afterwards.
Template function parallel_pipeline supports only linear pipelines. It does not directly handle more baroque plumbing, such as in the diagram below.
Mutual exclusion is necessary when at least one thread writes to a shared variable. But it does no harm to permit multiple readers into a protected region. The reader-writer variants of the mutexes, denoted by _rw_ in the class names, enable multiple readers by distinguishing reader locks from writer locks. There can be more than one reader lock on a given mutex.