Further Thread Pools
The thread management utilities proposed in the vath library are discussed in this chapter: the SPool and NPool thread pool classes implementing, respectively, a thread-centric or a task-centric programming environment. The NPool class has an internal task scheduler that is less refined than those available in OpenMP or TBB, but the fact that these pools are explicit—users can create as many pools as they want or need, and they can be combined—simplifies the programming of certain parallel contexts. These classes introduce the notion of a parallel job as a C++ object, and the public user interfaces are very simple to use. Several examples are proposed for testing the pool operations, and at the end ...
Get Shared Memory Application Programming now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.