|
CNum 0.2.1
CPU-optimized ML library for C++
|
A promise based thread pool. More...
#include <ThreadPool.h>
Public Member Functions | |
| ~ThreadPool () | |
| Destructor. | |
| ThreadPool (const ThreadPool &other)=delete | |
| ThreadPool & | operator= (const ThreadPool &other)=delete |
| ThreadPool (ThreadPool &&other)=delete | |
| ThreadPool & | operator= (ThreadPool &&other)=delete |
| void | shutdown () |
| Shut the ThreadPool down. | |
| template<typename T> | |
| std::future< T > | submit (std::function< T(arena_t *arena) > f) |
| Submit a task to the ThreadPool. | |
Static Public Member Functions | |
| static ThreadPool * | get_thread_pool (ThreadPoolConfig config={ default_arena_init_block_ct }) |
| Get the instance of the ThreadPool singleton. | |
| static int | get_worker_id () |
| Get the thread-local id of a worker. | |
A promise based thread pool.
| CNum::Multithreading::ThreadPool::~ThreadPool | ( | ) |
Destructor.
|
delete |
|
delete |
|
static |
Get the instance of the ThreadPool singleton.
| config | The configuration of the ThreadPool |
|
static |
Get the thread-local id of a worker.
|
delete |
|
delete |
| void CNum::Multithreading::ThreadPool::shutdown | ( | ) |
Shut the ThreadPool down.
|
inline |
Submit a task to the ThreadPool.
| f | The task |