Autowiring  1.0.3
A C++ Inversion of Control Framework
autowiring::SystemThreadPool Class Reference

A thread pool that makes use of the underlying system's APIs More...

#include <SystemThreadPool.h>

Inheritance diagram for autowiring::SystemThreadPool:
autowiring::ThreadPool

Public Member Functions

virtual void SuggestThreadPoolSize (size_t nThreads)
 Makes a recommendation as to the number of worker threads that should be used to process work More...
 
- Public Member Functions inherited from autowiring::ThreadPool
virtual void Consume (const std::shared_ptr< DispatchQueue > &dq)
 Causes the thread pool to call all lambdas specified on the passed DispatchQueue More...
 
bool IsStarted (void) const
 
Returns
True if the thread pool is running

 
template<class Fx >
bool operator+= (Fx &&fx)
 Submits the specified lambda to this context's ThreadPool for processing More...
 
virtual std::shared_ptr< void > Start (void)
 Begins processing on this thread pool More...
 
virtual bool Submit (std::unique_ptr< DispatchThunkBase > &&thunk)=0
 Adds the specified thunk to be executed by the thread pool at some later time More...
 

Additional Inherited Members

- Protected Member Functions inherited from autowiring::ThreadPool
virtual void OnStartUnsafe (void)
 Called when the thread pool is first started More...
 
virtual void OnStop (void)
 Called when the thread pool is being cleaned up More...
 

Detailed Description

A thread pool that makes use of the underlying system's APIs

Member Function Documentation

virtual void autowiring::SystemThreadPool::SuggestThreadPoolSize ( size_t  nThreads)
inlinevirtual

Makes a recommendation as to the number of worker threads that should be used to process work

Implementations are free to ignore this request. An implementation may honor this request and then immediately change the number of pooled threads. Passing a value of 0 does not guarantee that any threads will exit.

Resizing the number of worker threads may potentially be very expensive on certain systems. This method should only be called during setup or during major stateful changes on the system.


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