Chapter 12

Further Thread Pools

Abstract

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 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.