The answer to my question about Thread Building Blocks’ usefulness for non-algorithmic parallelization (i.e., in a word, threading ;) was tucked away in a Change Log (it seems that TBB could use a little work on its documentation revision, and the book predates the change).
ISO C++ thread class – A thin portable wrapper around OS threads. It’s a close approximation of the ISO C++ 200x class thread (Section 30.2 of http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2691.pdf). Now TBB lets you choose which is best, task-based versus thread-based, for your situation. Threads are typically better than tasks when the “work” is really more waiting than computation, such as for:
- GUI, I/O or network interface threads.
- Threads that need to wait on external events.
- Programs that previously needed to use both native threads and Intel® TBB tasks.
Well, at least now I have a more immediately useful pet-project to work on: writing a generic encapsulation of a resource-sharing and resource-specific worker pool. Resource-sharing: a shared pool of resources which the workers variously use – which they use is indefinite i.e. a resource; Resource-specific: a pool that will handle specific actions for specific resources, i.e. this specific resource.
Resource-sharing: Write this data to any database handle in the pool; Resource-specific: Someone write this data to connection #42.