libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
This is the batch that the main thread will process. More...
#include <thread_pool_queue_model.hpp>
Public Types | |
typedef PTT | pool_traits_type |
typedef pool_traits_type::os_traits | os_traits |
typedef Pt | pool_type |
typedef os_traits::thread_traits | thread_traits |
using | signalled_work_queue_type = typename pool_traits_type::template signalled_work_queue_type< QM > |
using | batch_details_type = batch_details< pool_traits_type::GSSk, signalled_work_queue_type, typename remove_shared_ptr< typename pool_type::value_type, api_lock_traits< platform_api, sequential_mode > >::value_type::statistics_type > |
Return a container of GSSkSz items from the front of the queue to implement the GSS(k) or bakers' scheduling algorithm. More... | |
typedef batch_details_type::statistics_type | statistics_type |
Public Member Functions | |
GSSk_batching (const typename thread_traits::api_params_type::tid_type mtid) noexcept(true) FORCE_INLINE | |
bool __fastcall | process_a_batch_item (pool_type &pool, const typename thread_traits::api_params_type::tid_type tid, typename os_traits::thread_exception const &exception_thrown_in_thread) noexcept(false) FORCE_INLINE |
Process an closure_base-derived closure item from the batch of a pool_thread. More... | |
bool __fastcall | add_work_to_batch (pool_type &pool, const typename thread_traits::api_params_type::tid_type tid, typename signalled_work_queue_type::value_type &&wk) noexcept(true) FORCE_INLINE |
Put the closure_base-derived closure in the batch, if it is empty. More... | |
statistics_type const &__fastcall | statistics () const noexcept(true) FORCE_INLINE |
statistics_type &__fastcall | statistics () noexcept(true) FORCE_INLINE |
Static Public Attributes | |
static constexpr unsigned long | GSSk =batch_details_type::GSSk |
This is the batch that the main thread will process.
Definition at line 33 of file thread_pool_queue_model.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::batch_details_type = batch_details<pool_traits_type::GSSk, signalled_work_queue_type, typename remove_shared_ptr<typename pool_type::value_type, api_lock_traits<platform_api, sequential_mode> >::value_type::statistics_type> |
Return a container of GSSkSz items from the front of the queue to implement the GSS(k) or bakers' scheduling algorithm.
Definition at line 41 of file thread_pool_queue_model.hpp.
typedef pool_traits_type::os_traits jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::os_traits |
Definition at line 36 of file thread_pool_queue_model.hpp.
typedef PTT jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::pool_traits_type |
Definition at line 35 of file thread_pool_queue_model.hpp.
typedef Pt jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::pool_type |
Definition at line 37 of file thread_pool_queue_model.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::signalled_work_queue_type = typename pool_traits_type::template signalled_work_queue_type<QM> |
Definition at line 39 of file thread_pool_queue_model.hpp.
typedef batch_details_type::statistics_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::statistics_type |
Definition at line 42 of file thread_pool_queue_model.hpp.
typedef os_traits::thread_traits jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::thread_traits |
Definition at line 38 of file thread_pool_queue_model.hpp.
|
inlineexplicitnoexcept |
Definition at line 45 of file thread_pool_queue_model.hpp.
|
inlinenoexcept |
Put the closure_base-derived closure in the batch, if it is empty.
Note that this function runs with no locks, as it presumes that the caller is the same pool_thread that consumes the work from the batch.
pool | The thread_pool_base-derived thread pool to which the wk will be transferred. |
tid | The thread_id of the pool_thread to which the closure_base-derived closure should be added, if possible. |
wk | The closure_base-derived closure to attempt to add. |
Definition at line 83 of file thread_pool_queue_model.hpp.
|
inlinenoexcept |
Process an closure_base-derived closure item from the batch of a pool_thread.
pool | The thread pool. |
tid | The thread_id of the pool_thread to query the batch for more work. |
Definition at line 57 of file thread_pool_queue_model.hpp.
|
inlinenoexcept |
Definition at line 97 of file thread_pool_queue_model.hpp.
|
inlinenoexcept |
Definition at line 100 of file thread_pool_queue_model.hpp.
|
staticconstexpr |
Definition at line 43 of file thread_pool_queue_model.hpp.