Hermes
0.9.5-beta
Hierarchical Distributed I/O Buffering System
|
#include <thread_pool.h>
Public Member Functions | |
ThreadPool (unsigned num_threads=std::thread::hardware_concurrency()) | |
template<typename F , typename R = std::result_of_t<F && ()>> | |
std::future< R > | run (F &&f, bool high_priority=false) const |
Private Attributes | |
std::vector< std::thread > | threads |
std::queue< std::packaged_task< void()> > | queue_low |
std::queue< std::packaged_task< void()> > | queue_high |
std::mutex | mutex |
std::condition_variable | condvar |
A class to represent thread pool
|
inlineexplicit |
construct thread pool with num_threads number of threads
|
inline |
a template for running thread pool
|
private |
a vector of threads
|
mutableprivate |
high-priority queue
|
mutableprivate |
low-priority queue
|
mutableprivate |
mutex lock
|
mutableprivate |
conditional variable