suanPan
Loading...
Searching...
No Matches
thread_pool Class Reference

#include <thread_pool.hpp>

Collaboration diagram for thread_pool:

Public Member Functions

 thread_pool (const concurrency_t thread_count_=0)
 
 ~thread_pool ()
 
concurrency_t get_thread_count () const
 
template<typename F , typename T1 , typename T2 , typename T = std::common_type_t<T1, T2>>
void push_loop (T1 first_index_, T2 index_after_last_, F &&loop, size_t num_blocks=0)
 
template<typename F , typename T >
void push_loop (const T index_after_last, F &&loop, const size_t num_blocks=0)
 
template<typename F , typename... A>
void push_task (F &&task, A &&... args)
 
template<typename F , typename... A, typename R = std::invoke_result_t<std::decay_t<F>, std::decay_t<A>...>>
std::future< R > submit (F &&task, A &&... args)
 
void wait_for_tasks ()
 

Constructor & Destructor Documentation

◆ thread_pool()

thread_pool::thread_pool ( const concurrency_t thread_count_ = 0)
inlineexplicit

◆ ~thread_pool()

thread_pool::~thread_pool ( )
inline

Member Function Documentation

◆ get_thread_count()

concurrency_t thread_pool::get_thread_count ( ) const
inline

◆ push_loop() [1/2]

template<typename F , typename T >
void thread_pool::push_loop ( const T index_after_last,
F && loop,
const size_t num_blocks = 0 )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_loop() [2/2]

template<typename F , typename T1 , typename T2 , typename T = std::common_type_t<T1, T2>>
void thread_pool::push_loop ( T1 first_index_,
T2 index_after_last_,
F && loop,
size_t num_blocks = 0 )
inline

◆ push_task()

template<typename F , typename... A>
void thread_pool::push_task ( F && task,
A &&... args )
inline
Here is the caller graph for this function:

◆ submit()

template<typename F , typename... A, typename R = std::invoke_result_t<std::decay_t<F>, std::decay_t<A>...>>
std::future< R > thread_pool::submit ( F && task,
A &&... args )
inline

◆ wait_for_tasks()

void thread_pool::wait_for_tasks ( )
inline
Here is the caller graph for this function:

The documentation for this class was generated from the following file: