O'Reilly logo

Intel Threading Building Blocks by James Reinders

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Much Better Than Raw Native Threads

The task scheduler manages a thread pool and hides the complexity of native threads. The parallel algorithms (covered in Chapter 3) are all based on the task scheduler interface. The task scheduler is designed to address common performance issues of parallel programming with native threads, specifically those issues listed in Table 9-1. The following subsections of this chapter offer details on each item in the table.

Table 9-1. Problems with raw threads

Problem

Intel Threading Building Blocks approach

Oversubscription

One scheduler thread per hardware thread.

Choice of scheduling policy

Nonpreemptive unfair scheduling.

High coding overhead

Programmer specifies tasks, not threads.

Load imbalances

Work stealing balances load.

Portability

No code changes should be needed to use with any C++ compiler on any operating system.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required