In the old days, people thought they could increase performance by keeping track of where threads are assigned, and knowing the scalability of each implementation of each algorithm on each piece of hardware, knowing what other people are running on the hardware, and then optimizing. Nowadays, where the same code may be running on a laptop, or a 48 core Xeon processor, with vastly different scaling considerations,and different jobs of different priority potentially scheduled on the same hardware, the practical solution to optimal performance is to have the task scheduler schedule tasks on to threads and then on to CPU cores to minimize the total run time for you. If you attempt to do this yourself, your best outcome is that you are as good as the task scheduler.All the other times, you are worse than the task scheduler.
In TBB, the scheduler knows if you should be running on one CPU only , or should be running on four, and adjusts that for you.
From the Intel TBB guide book:
There are a variety of approaches to parallel programming, ranging from using platform-dependent threading primitives to exotic new languages. The advantage of Intel Threading Building Blocks is that it works at a higher level than raw threads, yet does not require exotic languages or compilers. You can use it with any compiler supporting ISO C++. The library differs from typical threading packages in the following ways:
Intel Threading Building Blocks enables you to specify logical paralleism instead of threads. Most threading packages require you to specify threads. Programming directly in terms of threads can be tedious and lead to inefficient programs, because threads are low-level, heavy constructs that are close to the hardware. Direct programming with threads forces you to efficiently map logical tasks onto threads. In contrast, the Intel Threading Building Blocks run-time library automatically maps logical parallelism onto threads in a way that makes efficient use of processor resources.
Intel Threading Building Blocks targets threading for performance. Most general-purpose threading packages support many different kinds of threading, such as threading for asynchronous events in graphical user interfaces. As a result, general-purpose packages tend to be low-level tools that provide a foundation, not a solution. Instead, Intel Threading Building Blocks focuses on the particular goal of parallelizing computationally intensive work, delivering higher-level, simpler solutions.