iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::UnboundedLocalQueueThreadPool Class Reference

#include <nrt/Core/Design/ThreadPools.H>

An unbounded thread pool with thread local work queues.

This is a version of BoundedThreadPool that grows automatically as new jobs are pushed onto the thread pool.

Definition at line 164 of file ThreadPools.H.

Public Member Functions

 UnboundedLocalQueueThreadPool (size_t const initialThreads=std::thread::hardware_concurrency(), size_t const maxThreads=std::numeric_limits< size_t >::max())
 
template<class Func >
std::future< typename
std::result_of< Func()>::type > 
pushJob (Func f)
 
void runPendingTask ()
 

Protected Member Functions

void checkAndIncrease ()
 
void workerThread (size_t index)
 
bool popTaskFromLocalQueue (FunctionWrapper &task)
 
bool popTaskFromPoolQueue (FunctionWrapper &task)
 
bool popTaskFromOtherThreadQueue (FunctionWrapper &task)
 

The documentation for this class was generated from the following files: