fw4spl
|
This class creates and manages a pool of threads which process tasks. More...
#include <Pool.hpp>
Public Types | |
typedef std::shared_ptr< Pool > | sptr |
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 | |
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.