Elements of Thinking Parallel
Threading Building Blocks was designed to make expressing parallelism much easier by abstracting away details and providing strong support for the best ways to program for parallelism. Here is a quick overview of how Threading Building Blocks addresses the topics we will define and review in this chapter:
- Decomposition
Learning to decompose your problem into concurrent tasks (tasks that can run at the same time).
- scaling
Expressing a problem so that there are enough concurrent tasks to keep all the processor cores busy while minimizing the overhead of managing the parallel program.
- Threads
A guide to the technology underlying the concurrency in programs—and how they are abstracted by Threading Building Blocks so that you can just focus on your tasks.
- Correctness
How the implicit synchronization inherent in Threading Building Blocks helps minimize the use of locks. If you still must use locks, there are special features for using the Intel Thread Checker to find deadlocks and race conditions, which result from errors involving locks.
- Abstraction and patterns
How to choose and utilize algorithms, from Chapter 3 and Chapter 4.
- Caches
A key consideration in improving performance. The Threading Build Blocks task scheduler is already tuned for caches.
- Intuition
Thinking in terms of tasks that can run at the same time (concurrent tasks), data decomposed to minimize conflicts among tasks, and recursion.
In everyday life, we find ourselves thinking about parallelism. ...