Rosetta
RosettaThreadPool.hh File Reference

A container for a pool of threads. Threads idle continuously until loaded with a function to execute. A subset of threads then execute the function synchronously and then return to the idle state. More...

Detailed Description

A container for a pool of threads. Threads idle continuously until loaded with a function to execute. A subset of threads then execute the function synchronously and then return to the idle state.

Note
The basic verison of this class assigns functions to threads on a first-come, first-served basis. If I request 8 threads and 8 threads are idle, I get all 8 threads. If the next request also asks for 8 threads while I'm still using mine, it only gets the thread that made the request. Derived classes can implement different behaviour for assigning work to threads.
Author
Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.iron.nosp@m.insti.nosp@m.tute.nosp@m..org)