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 |
---|---|
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. |
18.223.106.232