iLab Neuromorphic Robotics Toolkit
0.1
|
#include <nrt/Core/Design/ThreadPools.H>
A bounded thread pool with a shared work queue.
This thread pool consists of some fixed number of threads which attempt to get jobs from a work queue, sleeping while they have no work to do.
The work queue is shared amongst all threads.
Based off of an implementation in C++ Concurrency in Action: Practical Multithreading by Anthony Williams
Definition at line 57 of file ThreadPools.H.
Public Member Functions | |
BoundedThreadPool (size_t const numThreads=std::thread::hardware_concurrency()) | |
template<class Func > | |
std::future< typename std::result_of< Func()>::type > | pushJob (Func f) |
Protected Member Functions | |
void | workerThread () |