Represents thread pool.
More...
#include <ThreadPool.hpp>
template<typename R = int>
class CppMate::ThreadPool< R >
Represents thread pool.
◆ ThreadPool() [1/3]
template<typename R = int>
Constructor.
- Parameters
-
maxThreads | the desired value of maximum possible threads in the pool. Zero value means choosing an optimal value for the current platform. |
◆ ThreadPool() [2/3]
template<typename R = int>
◆ ThreadPool() [3/3]
template<typename R = int>
◆ ~ThreadPool()
template<typename R = int>
◆ addTask()
template<typename R = int>
template<typename F , typename... A>
Adds a new task for execution.
- Parameters
-
task | the task to add. |
args | the task arguments. |
- Returns
- future object to tracking task results.
- Exceptions
-
◆ getMaxThreads()
template<typename R = int>
Returns the maximum possible number of threads in the pool.
- Returns
- maximum possible number of threads in the pool.
◆ getPendingTasksCount()
template<typename R = int>
Returns number of pending tasks at the moment.
- Returns
- number of pending tasks at the moment.
◆ getWaitingCount()
template<typename R = int>
Returns the number of workers is waiting for a job.
- Returns
- number of workers is waiting for a job.
◆ getWorkersCount()
template<typename R = int>
Returns the number of active workers in the pool at the moment.
- Returns
- number of active workers in the pool at the moment.
◆ hasPendingTasks()
template<typename R = int>
Indicates that pool has at least one pending task at the moment.
- Returns
true
if pool has pending task(s); false
otherwise.
◆ operator=() [1/2]
template<typename R = int>
◆ operator=() [2/2]
template<typename R = int>
The documentation for this class was generated from the following file: