#include <pool.hpp>
osmium::thread::Pool::Pool |
( |
int |
num_threads, |
|
|
size_t |
max_queue_size |
|
) |
| |
|
inlineexplicitprivate |
Create thread pool with the given number of threads. If num_threads is 0, the number of threads is read from the environment variable OSMIUM_POOL_THREADS. The default value in that case is -2.
If the number of threads is a negative number, it will be set to the actual number of cores on the system plus the given number, ie it will leave a number of cores unused.
In all cases the minimum number of threads in the pool is 1.
osmium::thread::Pool::~Pool |
( |
| ) |
|
|
inline |
static Pool& osmium::thread::Pool::instance |
( |
| ) |
|
|
inlinestatic |
bool osmium::thread::Pool::queue_empty |
( |
| ) |
const |
|
inline |
size_t osmium::thread::Pool::queue_size |
( |
| ) |
const |
|
inline |
void osmium::thread::Pool::shutdown_all_workers |
( |
| ) |
|
|
inline |
template<typename TFunction >
std::future<typename std::result_of<TFunction()>::type> osmium::thread::Pool::submit |
( |
TFunction && |
func | ) |
|
|
inline |
void osmium::thread::Pool::worker_thread |
( |
| ) |
|
|
inlineprivate |
constexpr int osmium::thread::Pool::default_num_threads = 0 |
|
static |
int osmium::thread::Pool::m_num_threads |
|
private |
std::vector<std::thread> osmium::thread::Pool::m_threads |
|
private |
The documentation for this class was generated from the following file: