|
Electroneum
|
Manages zero or more threads for work dispatching. More...
#include <thread_group.h>
Classes | |
| class | data |
Public Member Functions | |
| thread_group () | |
| Create an optimal number of threads. More... | |
| thread_group (std::size_t count) | |
Create exactly count threads. More... | |
| thread_group (thread_group const &)=delete | |
| thread_group (thread_group &&)=delete | |
| ~thread_group ()=default | |
| Joins threads, but does not necessarily run all dispatched functions. More... | |
| thread_group & | operator= (thread_group const &)=delete |
| thread_group & | operator= (thread_group &&)=delete |
| std::size_t | count () const noexcept |
| bool | try_run_one () noexcept |
| template<typename F > | |
| void | dispatch (F &&f) |
Static Public Member Functions | |
| static std::size_t | optimal () |
| static std::size_t | optimal_with_max (std::size_t count) |
Private Attributes | |
| boost::optional< data > | internal |
Manages zero or more threads for work dispatching.
|
inlineexplicit |
Create an optimal number of threads.
|
explicit |
Create exactly count threads.
|
delete |
|
delete |
|
default |
Joins threads, but does not necessarily run all dispatched functions.
|
inlinenoexcept |
this group.
|
inline |
f is invoked immediately if count() == 0, otherwise execution of f is queued for next available thread. If f is queued, any exception leaving that function will result in process termination. Use std::packaged_task if exceptions need to be handled.
|
delete |
|
delete |
|
static |
get_max_concurrency() ? get_max_concurrency() - 1 : 0
|
static |
count ? min(count - 1, optimal()) : 0
|
inlinenoexcept |
this_thread).
|
private |
1.8.14