February 2019
Intermediate to advanced
592 pages
20h 37m
English
This chapter covers
In earlier chapters, you’ve been explicitly managing threads by creating std::thread objects for every thread. In a couple of places you’ve seen how this can be undesirable, because you then have to manage the lifetime of the thread objects, determine the number of threads appropriate to the problem and to the current hardware, and so forth. The ideal scenario would be that you could divide the code into the smallest pieces that could be executed concurrently, pass them over to the compiler and library, and say, “Parallelize this for optimal performance.” As we’ll see in chapter ...