#include <leader_follower_thread_pool.hpp>
This thread pool class implements the leader follower pattern.
◆ leader_follower_thread_pool()
template<typename F >
matador::leader_follower_thread_pool::leader_follower_thread_pool |
( |
std::size_t |
size, |
|
|
F |
join_func |
|
) |
| |
|
inline |
Creates a new leader follower thread pool instance with the given thread pool size and given join function.
- Template Parameters
-
- Parameters
-
size | Number of threads |
join_func | Join function. |
◆ is_running()
bool matador::leader_follower_thread_pool::is_running |
( |
| ) |
const |
Returns true if the thread pool is running.
- Returns
- True if thread pool is running.
◆ leader()
std::thread::id matador::leader_follower_thread_pool::leader |
( |
| ) |
|
Returns the thread id of the current leading thread.
- Returns
- Thread id of the leading thread.
◆ num_follower()
std::size_t matador::leader_follower_thread_pool::num_follower |
( |
| ) |
const |
Returns the current number of thread followers.
- Returns
- Number of follower threads.
◆ promote_new_leader()
void matador::leader_follower_thread_pool::promote_new_leader |
( |
| ) |
|
Promotes the next new leading thread.
◆ shutdown()
void matador::leader_follower_thread_pool::shutdown |
( |
| ) |
|
Shuts the thread pool down.
◆ size()
std::size_t matador::leader_follower_thread_pool::size |
( |
| ) |
const |
Returns number of threads.
- Returns
- Number of threads.
◆ start()
void matador::leader_follower_thread_pool::start |
( |
| ) |
|
◆ stop()
void matador::leader_follower_thread_pool::stop |
( |
| ) |
|
The documentation for this class was generated from the following file:
- matador/net/leader_follower_thread_pool.hpp