|
ThreadSchedule 3.0.0
Modern C++ thread management library
|
Value type for pool worker count. More...
#include <worker_count.hpp>
Public Member Functions | |
| worker_count () noexcept=default | |
| Construct automatic worker count. | |
| worker_count (std::size_t value) | |
| Construct explicit worker count. | |
| constexpr auto | is_automatic () const noexcept -> bool |
| Return whether this instance uses automatic resolution. | |
| auto | resolve () const noexcept -> std::size_t |
| Resolve the effective worker count. | |
Static Public Member Functions | |
| static constexpr auto | automatic () noexcept -> worker_count |
| Create automatic worker count. | |
| static auto | create (std::size_t value) noexcept -> result< worker_count > |
| Create explicit worker count without exceptions. | |
Value type for pool worker count.
The special automatic value resolves to at least one worker using std::thread::hardware_concurrency().
Definition at line 24 of file worker_count.hpp.
|
defaultnoexcept |
Construct automatic worker count.
Referenced by automatic(), and create().
|
inlineexplicit |
Construct explicit worker count.
| value | Number of workers, must be > 0. |
| std::invalid_argument | if value is zero. |
Definition at line 34 of file worker_count.hpp.
|
inlinestaticconstexprnoexcept |
Create automatic worker count.
Definition at line 41 of file worker_count.hpp.
References worker_count().
|
inlinestaticnoexcept |
Create explicit worker count without exceptions.
| value | Number of workers, must be > 0. |
errc::invalid_argument. Definition at line 52 of file worker_count.hpp.
References worker_count().
|
inlineconstexprnoexcept |
Return whether this instance uses automatic resolution.
Definition at line 61 of file worker_count.hpp.
Referenced by resolve().
|
inlinenoexcept |
Resolve the effective worker count.
max(1, hardware_concurrency). Definition at line 71 of file worker_count.hpp.
References is_automatic().
Referenced by threadschedule::advanced::global_thread_pool::init(), and threadschedule::advanced::global_work_stealing_pool::init().