This articlemay rely excessively on sourcestoo closely associated with the subject, potentially preventing the article from beingverifiable andneutral. Please helpimprove it by replacing them with more appropriatecitations toreliable, independent sources.(January 2016) (Learn how and when to remove this message) |
Developer(s) | Intel |
---|---|
Stable release | |
Repository | |
Written in | C++ |
Operating system | FreeBSD, Linux, Solaris, macOS, Windows, Android |
Type | library orframework |
License | dual: commercial / open source (Apache 2.0), plus Freeware[2] |
Website | github intel |
oneAPIThreading Building Blocks (oneTBB; formerly Threading Building Blocks or TBB) is aC++templatelibrary developed byIntel forparallel programming onmulti-core processors. Using TBB, a computation is broken down intotasks that can run in parallel. The library manages andschedulesthreads to execute these tasks.
A oneTBB program creates, synchronizes, and destroys graphs of dependent tasks according toalgorithms, 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 implementswork 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 fromPrinceton University 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.[3]
oneTBB, like theSTL (and the part of the C++ standard library based on it), uses templates extensively. This has the advantage of low-overheadpolymorphism, since templates are a compile-time construct which modern C++compilers can largely optimize away.
oneTBB is available commercially as a binary distribution with support,[4] and asopen-source software in both source and binary forms.
oneTBB does not provide guarantees ofdeterminism or freedom fromdata races.[5]
oneTBB is a collection of components for parallel programming:
parallel_for
,parallel_reduce
,parallel_scan
parallel_pipeline
,parallel_sort
concurrent_queue
,concurrent_priority_queue
,concurrent_vector
,concurrent_hash_map
,concurrent_unordered_map
,concurrent_unordered_set
,concurrent_map
,concurrent_set
scalable_malloc
,scalable_free
,scalable_realloc
,scalable_calloc
,scalable_allocator
,cache_aligned_allocator
mutex
,spin_mutex
,queuing_mutex
,spin_rw_mutex
,queuing_rw_mutex
,recursive_mutex