oneAPI Threading Building Blocks (oneTBB; formerly Threading Building Blocks or TBB) is a
C++ template library
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
developed by
Intel
Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
for
parallel programming
Parallel computing is a type of computing, computation in which many calculations or Process (computing), processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. ...
on
multi-core processor
A multi-core processor (MCP) is a microprocessor on a single integrated circuit (IC) with two or more separate central processing units (CPUs), called ''cores'' to emphasize their multiplicity (for example, ''dual-core'' or ''quad-core''). Ea ...
s. Using TBB, a computation is broken down into
tasks that can run in parallel. The library manages and
schedules threads to execute these tasks.
Overview
A oneTBB program creates, synchronizes, and destroys graphs of dependent tasks according to ''algorithms'', i.e. high-level parallel programming paradigms (a.k.a.
Algorithmic Skeletons). Tasks are then executed respecting graph dependencies. This approach groups TBB in a family of techniques for parallel programming aiming to decouple the programming from the particulars of the underlying machine.
oneTBB implements
work stealing to balance a parallel workload across available processing cores in order to increase core utilization and therefore scaling. Initially, the workload is evenly divided among the available processor cores. If one core completes its work while other cores still have a significant amount of work in their queue, oneTBB reassigns some of the work from one of the busy cores to the idle core. This dynamic capability decouples the programmer from the machine, allowing applications written using the library to scale to utilize the available processing cores with no changes to the source code or the executable program file. In a 2008 assessment of the work stealing implementation in TBB, researchers from
Princeton University
Princeton University is a private university, private Ivy League research university in Princeton, New Jersey, United States. Founded in 1746 in Elizabeth, New Jersey, Elizabeth as the College of New Jersey, Princeton is the List of Colonial ...
found that it was suboptimal for large numbers of processors cores, causing up to 47% of computing time spent in scheduling overhead when running certain benchmarks on a 32-core system.
oneTBB, like the
STL (and the part of the C++ standard library based on it), uses templates extensively. This has the advantage of low-overhead
polymorphism, since templates are a compile-time construct which modern C++
compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
s can largely optimize away.
oneTBB is available commercially as a binary distribution with support,
[https://software.intel.com/en-us/intel-tbb Intel Threading Building Blocks Commercial Version Homepage] and as
open-source software
Open-source software (OSS) is Software, computer software that is released under a Open-source license, license in which the copyright holder grants users the rights to use, study, change, and Software distribution, distribute the software an ...
in both source and binary forms.
oneTBB does not provide guarantees of
determinism
Determinism is the Metaphysics, metaphysical view that all events within the universe (or multiverse) can occur only in one possible way. Deterministic theories throughout the history of philosophy have developed from diverse and sometimes ov ...
or freedom from
data races.
Library contents
oneTBB is a collection of components for parallel programming:
* Basic algorithms:
parallel_for
,
parallel_reduce
,
parallel_scan
* Advanced algorithms:
parallel_pipeline
,
parallel_sort
*
Container
A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping.
Things kept inside of a container are protected on several sides by being inside of its structure. The term ...
s:
concurrent_queue
,
concurrent_priority_queue
,
concurrent_vector
,
concurrent_hash_map
,
concurrent_unordered_map
,
concurrent_unordered_set
,
concurrent_map
,
concurrent_set
* Memory allocation:
scalable_malloc
,
scalable_free
,
scalable_realloc
,
scalable_calloc
,
scalable_allocator
,
cache_aligned_allocator
*
Mutual exclusion:
mutex
,
spin_mutex
,
queuing_mutex
,
spin_rw_mutex
,
queuing_rw_mutex
,
recursive_mutex
* Timing: portable fine grained global time stamp
* Task scheduler: direct access to control the creation and activation of tasks
See also
Intel oneAPI Base Toolkit* Intel
Integrated Performance Primitives (IPP)
* Intel oneAPI
Data Analytics Library (oneDAL)
* Intel oneAPI
Math Kernel Library (oneMKL)
* Intel Cryptography Primitives Library
*
Intel Advisor
*
Intel Inspector
*
Intel VTune Profiler
*
Intel Concurrent Collections (CnC)
*
Algorithmic skeleton
*
Parallel computing
Parallel computing is a type of computing, computation in which many calculations or Process (computing), processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. ...
*
List of C++ multi-threading libraries
*
List of C++ template libraries
*
Parallel Patterns Library
*
Grand Central Dispatch (GCD)
Software Architecture Building Blocks
Notes
References
*
*
*
*
*
External links
*
* at Intel
{{Parallel Computing
Concurrent programming libraries
Application programming interfaces
C++ programming language family
Generic programming
Threads (computing)
C++ libraries
Intel software