Threading Building Blocks
{{short description|C++ programming library}}
{{third-party|date=January 2016}}
{{Infobox software
| name = Threading Building Blocks
| logo =
| screenshot =
| caption =
| collapsible =
| author =
| developer = Intel
| released =
| latest release version = 2021.8
| latest release date = {{Release date and age|2023|02|17}}{{cite web |title= oneAPI Threading Building Blocks Github Releases |website=GitHub |url=https://github.com/oneapi-src/oneTBB/releases}}
| latest preview version =
| latest preview date =
| frequently updated =
| programming language = C++
| operating system = FreeBSD, Linux, Solaris, macOS, Windows, Android
| platform =
| size =
| language =
| status =
| genre = library or framework
| license = dual: commercial / open source (Apache 2.0), plus Freeware{{cite web|title=No Cost Options for Intel Support yourself, Royalty-Free|url=https://software.intel.com/en-us/free_tools_and_libraries}}
| website = {{URL|https://github.com/oneapi-src/oneTBB}}
{{URL|intel.com/oneTBB}}
}}
oneAPI Threading Building Blocks (oneTBB; formerly Threading Building Blocks or TBB) is a C++ template library developed by Intel for parallel programming on multi-core processors. 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 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.{{cite conference |last1=Contreras |first1=Gilberto |first2=Margaret |last2=Martonosi |title=Characterizing and improving the performance of Intel Threading Building Blocks |conference=IEEE Int'l Symp. on Workload Characterization |year=2008 |url=http://www.iiswc.org/iiswc2008/Papers/006.pdf}}
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++ compilers 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 in both source and binary forms.
oneTBB does not provide guarantees of determinism or freedom from data races.{{cite conference |first1=Robert L. |last1=Bocchino Jr. |first2=Vikram S. |last2=Adve |first3=Sarita V. |last3=Adve |first4=Marc |last4=Snir |title=Parallel Programming Must Be Deterministic by Default |conference=USENIX Workshop on Hot Topics in Parallelism |year=2009 |url=https://www.usenix.org/legacy/event/hotpar09/tech/full_papers/bocchino/bocchino_html/}}
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
- Containers:
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
- [https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit.html 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
- List of C++ multi-threading libraries
- List of C++ template libraries
- Parallel Patterns Library
- Grand Central Dispatch (GCD)
- [https://www.thoughtworks.com/insights/books/building-evolutionary-architectures Software Architecture Building Blocks]
Notes
{{reflist|30em}}
References
- {{Citation|last1=Voss|first1=Michael |last2=Asenjo|first2=Rafael |last3=Reinders|first3=James |date=2019 |title=Pro TBB|publisher=Apress|isbn=978-1-4842-4397-8|doi=10.1007/978-1-4842-4398-5 |s2cid=195847637 |url=http://www.oapen.org/download/?type=document&docid=1007323 |doi-access=free }}
- {{Citation|last=Reinders|first=James|date=July 2007|url=https://archive.org/details/intelthreadingbu0000rein|title=Intel Threading Building Blocks: Outfitting C++ for Multi-core Processor Parallelism|edition=Paperback|location=Sebastopol|publisher=O'Reilly Media|isbn=978-0-596-51480-8|url-access=registration}}
- {{Citation|last=Voss|first=M.|date=October 2006|url=http://www.devx.com/cplus/Article/32935|title=Demystify Scalable Parallelism with Intel Threading Building Blocks' Generic Parallel Algorithms|access-date=2007-06-06|archive-date=2012-02-05|archive-url=https://web.archive.org/web/20120205044110/http://www.devx.com/cplus/Article/32935|url-status=dead}}
- {{Citation|last=Voss|first=M.|date=December 2006|url=http://www.devx.com/cplus/Article/33334|title=Enable Safe, Scalable Parallelism with Intel Threading Building Blocks' Concurrent Containers|access-date=2007-06-06|archive-date=2012-02-05|archive-url=https://web.archive.org/web/20120205044133/http://www.devx.com/cplus/Article/33334|url-status=dead}}
- {{Citation|doi=10.1145/1133956.1133967|pages=74–83|chapter=McRT-Malloc|title=Proceedings of the 2006 international symposium on Memory management - ISMM '06|year=2006|last1=Hudson|first1=Richard L.|last2=Saha|first2=Bratin|last3=Adl-Tabatabai|first3=Ali-Reza|last4=Hertzberg|first4=Benjamin C.|isbn=978-1595932211|s2cid=9120368}}
External links
- [https://spec.oneapi.io/versions/latest/elements/oneTBB/source/nested-index.html oneTBB Industry Specification]
- {{github|oneapi-src/oneTBB}}
- {{Official website|intel.com/oneTBB}} at Intel
{{Intel software}}
{{Parallel Computing}}
Category:Concurrent programming libraries
Category:Application programming interfaces