fw4spl
fwThread::Pool Class Reference

This class creates and manages a pool of threads which process tasks. More...

#include <Pool.hpp>

Public Types

typedef std::shared_ptr< Poolsptr
 

Public Member Functions

FWTHREAD_API Pool ()
 this constructor launches as much as possible workers
 
FWTHREAD_API Pool (size_t)
 this constructor launches some amount of workers
 
FWTHREAD_API ~Pool ()
 the destructor joins all threads
 
template<class F , class... Args>
auto post (F &&f, Args &&...args) -> std::shared_future< typename std::result_of< F(Args...)>::type >
 add new work item to the pool
 

Detailed Description

This class creates and manages a pool of threads which process tasks.

The purpose of this class is to provide a set of threads that can be used to process tasks asynchronously.

Definition at line 32 of file Pool.hpp.


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