Jump to content

Threading Building Blocks

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ParallelWolverine (talk | contribs) at 08:25, 6 June 2007 (create page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Intel Threading Building Blocks (also known as TBB) describes a C++ template library for writing parallel programs.

TBB consists of data structures and algorithms that aim to simplify parllel programming in C++ by avoiding requiring a programmer to use native threading packages such as POSIX threads or Windows threads, or even the portable Boost Threads.

TBB uses templates thereby relying on compile-time polymorphism that is often more efficient than traditional run-time polymorphism. Modern C++ compilers are tuned to minimize any abstraction penalty arising from heavy use of templates such as STL and Intel Threading Building Blocks.

Library Contents

Threading Building Blocks is a collection of solutions needed for a parallel program:

  • Basic Algorithms: parallel_for, parallel_reduce, parallel_scan
  • Advanced Algorithms: parallel_while, pipeline, parallel_sort
  • Containers: concurrent_queue, concurrent_vector, concurrent_hash_map
  • Scalable Memory Allocation: scalable_malloc, scalable_free, scalable_realloc, scalable_calloc, scalable_allocator, cache_aligned_allocator
  • Mutual Exclusion: mutexspin_mutex, queuing_mutex, spin_rw_mutex, queuing_rw_mutex
  • Atomic Operations: fetch_and_add, fetch_and_increment, fetch_and_decrement, compare_and_swap, fetch_and_store
  • Timing: portable fine grained global time stamp
  • Task Scheduler: direct access to control the creation and activation of tasks

Acquisition

TBB is available for Windows, Linux, and Mac OS X. Intel sells TBB by itself and includes it in the Professional Edition of the Intel C++ Compiler.

Free versions are available, although a little difficult to find on the Intel web site:

History

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 specifing a grainsize parameter to estimate the best granularity for your tasks.

Version 1.1 was added to Intel C++ Compiler 10.0 with the new Professional Edition on June 5, 2007.

See Also

More on TBB algorithms:

More on TBB containers:

More on the TBB scalable memory allocator:

Intel product pages:

  • Standard Template Library
  • Parallel computing
  • Multi-core (computing)
  • An, P., A. Jula, et al. (2003). "STAPL: An Adaptive, Generic Parallel C++ Library." Workshop on Language and Compilers for Parallel Computing, 2001. Lecture Notes in Computer Science 2624, 193-208.
  • Austern, M.H., R.A. Towle, and A.A. Stepanov (1996). "Range partition adaptors: a mechanism for parallelizing STL." ACM SIGAPP Applied Computing Review. 4, 1, 5-6.
  • Blumofe, R. D., C. F. Joerg, et al. (1996). "Cilk: An Efficient Multithreaded Runtime System." Proceedings of the 5th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, 207-216. see also Cilk
  • Garcia, R., J. Järvi, et al. (2003, October). "A Comparative Study of Language Support for Generic Programming." Proceedings of the 2003 ACM SIGPLAN conference on object-oriented programming, systems, languages, and applications.
  • Halbherr, M., Y. Zhou, and Joerg, C. F. (1994, September). "MIMD-style parallel programming with continuation-passing threads." Proceedings of the 2nd International Workshop on Massive Parallelism: Hardware, Software, and Applications, Capri, Italy.
  • Mattson, T. G., B. A. Sanders, and B. L. Massingill (2004). Patterns for Parallel Programming. Reading, MA: Addison-Wesley.
  • Musser, D.R., and A.A. Stepanov (1994). "Algorithm-Oriented Generic Libraries." Software-Practice and Experience, 24(7), 623-642.
  • Musser, D. R., G. J. Derge, and A. Saini, with foreword by Alexander Stepanov (2001). STL Tutorial and Reference Guide, Second Edition: C++ Programming with the Standard Template Library, Boston, MA: Addison-Wesley, 2001. PDF
  • Plauger, P. J., M. Lee, et al (2000). C++ Standard Template Library, Prentice Hall.
  • Rauchwerger, L., Arzu, F., and Ouchi K. (1998, May). "Standard Templates Adaptive Parallel Library, Proceedings of the 4th International Workshop on Languages, Compilers,and Run-Time Systems for Scalable Computers (LCR), Pittsburgh, PA. Also Lecture Notes in Computer Science, 1511, Spinger-Verlag, 1998, pp.402-410.
  • Robison, A. D. (2006). "A Proposal to Add Parallel Iteration to the Standard Library."
  • Su, E., X. Tian, et al. (2002, September). "Compiler Support of the Workqueuing Execution Model for Intel SMP Architectures." Fourth European Workshop on OpenMP, Rome.
  • Sutter, H. (2005, January). "The Concurrency Revolution." Dr. Dobb's Journal.