libjmmcg
build_2783
A C++ library containing an eclectic mix of useful, advanced components.
|
This pool has a maximum specified size to which it will grow and reduce from, and the worker pool_threads steal work from a centrally-held signalled_work_queue. More...
#include <thread_pool_workers.hpp>
Public Member Functions | |
BOOST_MPL_ASSERT ((std::is_same< typename std::is_same< typename PTT::os_traits::thread_traits::model_type, sequential_mode >::type, std::false_type >)) | |
thread_pool (thread_pool const &)=delete | |
Create the thread pool. More... | |
__stdcall | ~thread_pool () noexcept(false) FORCE_INLINE |
template<typename ExecT_ > | |
erase_states __fastcall FORCE_INLINE | erase (ExecT_ &ec) |
Erase the specified, queued work. More... | |
const statistics_type __fastcall | statistics () const noexcept(true) FORCE_INLINE |
Obtain access to any statistics data collected by the operation of the thread_pool. More... | |
This pool has a maximum specified size to which it will grow and reduce from, and the worker pool_threads steal work from a centrally-held signalled_work_queue.
The internal signalled_work_queue is reasonably efficiently implemented: if there is enough work in the signalled_work_queue, the addition of the input_work to it can occur independently of the removal of the input_work by the worker pool_threads.
Definition at line 308 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::api_params_type = typename base_t::api_params_type |
Definition at line 341 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::base_t = private_::thread_pool_queue_model< pool_traits::work_distribution_mode_t::worker_threads_get_work<pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue>, pool_traits::size_mode_t::tracks_to_max, PTT, private_::fixed_pool_of_threads< PTT, pool::private_::thread_types::steal< PTT::result_traits_, typename PTT::os_traits, PTT, pool_traits::work_distribution_mode_t::worker_threads_get_work<pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue>::queue_model > > > |
Definition at line 337 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::GSSk_batching_type = typename base_t::GSSk_batching_type |
Definition at line 343 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::os_traits = typename base_t::os_traits |
Definition at line 339 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::pool_traits_type = typename base_t::pool_traits_type |
Definition at line 338 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::pool_type = typename base_t::pool_type |
Definition at line 342 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::signalled_work_queue_type = typename base_t::signalled_work_queue_type |
Definition at line 346 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::statistics_type = typename base_t::statistics_type |
Definition at line 344 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::thread_traits = typename base_t::thread_traits |
Definition at line 340 of file thread_pool_workers.hpp.
using jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::work_distribution_mode = typename base_t::work_distribution_mode |
Definition at line 345 of file thread_pool_workers.hpp.
Enumerator | |
---|---|
failed_to_erase | |
ignoring_result | |
erased_successfully |
Definition at line 350 of file thread_pool_workers.hpp.
|
delete |
Create the thread pool.
num_threads | The number of threads in the pool, which must be greater than zero. |
|
inlinenoexcept |
The destruction of the collection of threads is sequential, but the threads themselves can exit in parallel, thus speeding up the clean-up of the pool.
Definition at line 388 of file thread_pool_workers.hpp.
References jmmcg::ppd::control_flow_graph< OST >::add_cfg_details< Node >::params::params().
jmmcg::ppd::thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >::BOOST_MPL_ASSERT | ( | (std::is_same< typename std::is_same< typename PTT::os_traits::thread_traits::model_type, sequential_mode >::type, std::false_type >) | ) |
|
inline |
Erase the specified, queued work.
Note that if the work has started processing, it will not be erased.
ec | The execution context of the work to erase. |
Definition at line 406 of file thread_pool_workers.hpp.
|
inlinenoexcept |
Obtain access to any statistics data collected by the operation of the thread_pool.
Algorithmic complexity: O(pool_size()) Note that the value computed for the statistics_type::total_vertical_work() is guaranteed to be accurate. The value computed for the statistics_type::total_hrz_work() is guaranteed not be more than the value as if it were computed atomically. Therefore the following holds: statistics_type::total_work_added()>=statistics_type::total_vertical_work()+statistics_type::total_hrz_work()
Definition at line 421 of file thread_pool_workers.hpp.
References jmmcg::ppd::control_flow_graph< OST >::add_cfg_details< Node >::params::params().