Developer(s) | Intel |
---|---|
Stable release | 4.0 / September 8, 2011 |
Written in | C++ |
Operating system | FreeBSD, Linux, Solaris, Mac OS X, Microsoft Windows |
Type | library or framework |
License | dual: commercial / open source |
Intel Threading Building Blocks (also known as TBB) is a C++ template library developed by Intel Corporation for writing software programs that take advantage of multi-core processors. The library consists of data structures and algorithms that allow a programmer to avoid some complications arising from the use of native threading packages such as POSIX threads, Windows threads, or the portable Boost Threads in which individual threads of execution are created, synchronized, and terminated manually. Instead the library abstracts access to the multiple processors by allowing the operations to be treated as "tasks", which are allocated to individual cores dynamically by the library's run-time engine, and by automating efficient use of the cache. A TBB 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 solutions for parallel programming aiming to decouple the programming from the particulars of the underlying machine.
Contents |
TBB implements "task stealing" to balance a parallel workload across available processing cores in order to increase core utilization and therefore scaling. The TBB task stealing model is similar to the work stealing model applied in Cilk. 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, TBB 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.
TBB, like the STL, 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. The result is dense, fast code .
Intel TBB is available commercially as a binary distribution with support,[1] and in open source in both source and binary forms.[2]
TBB is a collection of components for parallel programming:
parallel_for
, parallel_reduce
, parallel_scan
parallel_while
, parallel_do
, parallel_pipeline
, parallel_sort
concurrent_queue
, concurrent_vector
, concurrent_hash_map
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
fetch_and_add
, fetch_and_increment
, fetch_and_decrement
, compare_and_swap
, fetch_and_store
Version 1.0 was introduced by Intel on August 29, 2006, the year after the introduction of Intel's first dual-core x86 processor, the Pentium D.
Version 1.1 was introduced on April 10, 2007. This version introduced auto_partitioner which offered an automatic alternative to specifying a grain size parameter to estimate the best granularity for your tasks. This version was added to the Intel C++ Compiler 10.0 with the new Professional Edition later that year on June 5.
Version 2.0 was introduced on July 24, 2007. This version included the release of the source code and the creation of an open source project.[2] The license used for open source is the same as the one previously used by the GNU Compiler Collection C++ standard library, a GPLv2 with a "runtime exception" (because of being template heavy code that usually becomes part of the executable after compilation). TBB is still available in a commercial version (without source code) with support but with no differences in functionality from the open source version.
Version 2.1 was introduced on July 22, 2008. Version 2.1 features included task-to-thread affinity, cancellation support, exception handling, and a portable thread wrapper.
Version 2.2 was introduced on August 5, 2009. [1] Version 2.2 features support for lambda functions in C++0x.
Version 3.0 was introduced on May 4, 2010. It has a number of improvements, see (http://software.intel.com/en-us/blogs/2010/05/04/tbb-30-new-today-version-of-intel-threading-building-blocks/)
Version 4.0 was introduced on September 8, 2011. It has several new features, see (http://threadingbuildingblocks.org/whatsnew.php)
The TBB commercial release 3.0 supports Microsoft Windows (XP or newer), Mac OS X (version 10.5.8 or higher) and Linux using various compilers (Visual C++ (version 8.0 or higher, on Windows OS only), Intel C++ Compiler (version 11.1 or higher) or GNU Compiler Collection (gcc)).[3] Additionally, the TBB open source community has contributed patches for Sun Solaris[4], PowerPC, Xbox 360, QNX Neutrino, and FreeBSD.
As of March 2010[update], TBB is available in FreeBSD and has been packaged into the following GNU/Linux and Sun Solaris distributions:
|