Intel® Threading Building Blocks

Task-Based Programming

When striving for performance, programming in terms of threads can be a poor way to do multithreaded programming. It is much better to formulate your program in terms of logical tasks, not threads, for several reasons.

  • Matching parallelism to available resources

  • Faster task startup and shutdown

  • More efficient evaluation order

Wavefront

Problem

Perform computations on items in a data set, where the computation on an item uses results from computations on predecessor items.

Context

The dependences between computations form an acyclic graph.

Thread Safety

Unless otherwise stated, the thread safety rules for the library are as follows:

  • Two threads can invoke a method or function concurrently on different objects, but not the same object.

  • It is unsafe for two threads to invoke concurrently methods or functions on the same object.

Subscribe to Intel® Threading Building Blocks