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

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

A thread pool with an unlimited number of threads.

Unlike the vanilla ThreadPool implementation, BottomlessThreadPool will always execute your job immediately. It does so by either passing it off to an idle thread (if one is available in the pool), or by creating a new thread (if all threads in the pool are currently busy).

Definition at line 53 of file BottomlessThreadPool.H.

Public Member Functions

 BottomlessThreadPool (size_t const initialThreads=std::thread::hardware_concurrency())
 Constructor.
 
 ~BottomlessThreadPool ()
 Destructor.
 
template<class Func >
std::future< typename
std::result_of< Func()>::type > 
pushJob (Func f)
 
size_t numThreads ()
 Execute a new job (with an arbitrary return type) in the thread pool. More...
 

Member Function Documentation

size_t nrt::BottomlessThreadPool::numThreads ( )
inline

Execute a new job (with an arbitrary return type) in the thread pool.

Get the number of threads in the pool

Definition at line 142 of file BottomlessThreadPoolImpl.H.


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