© Intel Corporation 2019
Michael Voss, Rafael  Asenjo and James ReindersPro TBBhttps://doi.org/10.1007/978-1-4842-4398-5_11

11. Controlling the Number of Threads Used for Execution

Michael Voss1 , Rafael Asenjo2 and James Reinders3
(1)
Austin, Texas, USA
(2)
Málaga, Spain
(3)
Portland, Oregon, USA
 

By default, the TBB library initializes its scheduler with what is typically the right number of threads to use. It creates one worker thread fewer than the number of logical cores on the platform, leaving one of the cores available to execute the main application thread. Because the TBB library implements parallelism using tasks that are scheduled on to these threads, this is usually the right amount of threads to have – there is exactly one software thread ...

Get Pro TBB: C++ Parallel Programming with Threading Building Blocks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.