Reputation: 658
In my code I call parallel_for twice:
parallel_for( do some stuff ); // I want this operation to finish first
parallel_for( do some other stuff ); // then I want to do this
1) Does this approach create physical threads twice ? and makes it slower ?
2) If needed, what would be the best method to replace those two calls of parallel_for ?
Upvotes: 0
Views: 363
Reputation: 6587
1) No, TBB has single shared pool of threads which are created lazily on demand. So lazily that completion of the first parallel_for
does not guarantee creation of all the threads.
2) Not needed.
Upvotes: 3