libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM > Class Template Reference

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
 

Detailed Description

template<unsigned long GSSkSz, class PTT, class Pt, class QM>
class jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >

This is the batch that the main thread will process.

Definition at line 33 of file thread_pool_queue_model.hpp.

Member Typedef Documentation

◆ batch_details_type

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
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.

◆ os_traits

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
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.

◆ pool_traits_type

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
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.

◆ pool_type

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
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.

◆ signalled_work_queue_type

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
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.

◆ statistics_type

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
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.

◆ thread_traits

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
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.

Constructor & Destructor Documentation

◆ GSSk_batching()

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::GSSk_batching ( const typename thread_traits::api_params_type::tid_type  mtid)
inlineexplicitnoexcept

Definition at line 45 of file thread_pool_queue_model.hpp.

Member Function Documentation

◆ add_work_to_batch()

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
bool __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::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 
)
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.

Parameters
poolThe thread_pool_base-derived thread pool to which the wk will be transferred.
tidThe thread_id of the pool_thread to which the closure_base-derived closure should be added, if possible.
wkThe closure_base-derived closure to attempt to add.
Returns
true if the closure_base-derived closure was added, false otherwise.
See also
batch_details::add_work_to_batch()

Definition at line 83 of file thread_pool_queue_model.hpp.

◆ process_a_batch_item()

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
bool __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::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 
)
inlinenoexcept

Process an closure_base-derived closure item from the batch of a pool_thread.

Parameters
poolThe thread pool.
tidThe thread_id of the pool_thread to query the batch for more work.
Returns
true if there is more closure_base-derived closure to process() in the pool_thread's batch, otherwise false.
See also
batch_details::process_a_batch_item()

Definition at line 57 of file thread_pool_queue_model.hpp.

◆ statistics() [1/2]

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
statistics_type const& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::statistics ( ) const
inlinenoexcept

Definition at line 97 of file thread_pool_queue_model.hpp.

◆ statistics() [2/2]

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
statistics_type& __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::statistics ( )
inlinenoexcept

Definition at line 100 of file thread_pool_queue_model.hpp.

Member Data Documentation

◆ GSSk

template<unsigned long GSSkSz, class PTT , class Pt , class QM >
constexpr unsigned long jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::GSSk_batching< GSSkSz, PTT, Pt, QM >::GSSk =batch_details_type::GSSk
staticconstexpr

Definition at line 43 of file thread_pool_queue_model.hpp.


The documentation for this class was generated from the following file: