libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats > Class Template Reference

Optimisation for when GSS(k)=GSS(1), i.e. no batching. More...

#include <thread_client_context.hpp>

Public Types

typedef WQ signalled_work_queue_type
 This is a container of GSSk items from the front of the queue to implement the GSS(k) or bakers' scheduling algorithm. More...
 
typedef Stats statistics_type
 The statistics to be gathered by the thread_pool, by default none. More...
 
typedef signalled_work_queue_type::value_type::no_ref_counting no_ref_counting
 
typedef signalled_work_queue_type::value_type::value_type::cfg_type cfg_type
 
typedef signalled_work_queue_type::value_type::value_type::work_complete_t work_complete_t
 
using eval_shared_del_t = eval_shared_deleter_t< typename signalled_work_queue_type::value_type >
 

Public Member Functions

 BOOST_STATIC_ASSERT (signalled_work_queue_type::max_size<=GSSk)
 
bool __fastcall batch_empty () const noexcept(true) FORCE_INLINE
 
constexpr __stdcall batch_details () noexcept(true) FORCE_INLINE
 
bool __fastcall add_work_to_batch (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...
 
void __fastcall refill_batch (signalled_work_queue_type &signalled_work_queue) noexcept(false) FORCE_INLINE
 
bool __fastcall process_a_batch_item () noexcept(false) FORCE_INLINE
 
void __fastcall process_a_batch (signalled_work_queue_type &signalled_work_queue) noexcept(false) FORCE_INLINE
 
const statistics_type &__fastcall statistics () const noexcept(true) FORCE_INLINE
 
statistics_type &__fastcall statistics () noexcept(true) FORCE_INLINE
 

Static Public Attributes

static constexpr unsigned long GSSk =1UL
 
static constexpr ppd::generic_traits::memory_access_modes memory_access_mode =eval_shared_del_t::memory_access_mode
 

Protected Member Functions

void __fastcall reload_batch_if_empty_nochk_nosig (signalled_work_queue_type &signalled_work_queue) noexcept(false) FORCE_INLINE
 
template<class UpdStats >
void FORCE_INLINE process_the_work (UpdStats &&update_stats, typename cfg_type::edge_annotation_t const e_details) noexcept(false)
 

Detailed Description

template<class WQ, class Stats>
class jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >

Optimisation for when GSS(k)=GSS(1), i.e. no batching.

Definition at line 268 of file thread_client_context.hpp.

Member Typedef Documentation

◆ cfg_type

template<class WQ , class Stats >
typedef signalled_work_queue_type::value_type::value_type::cfg_type jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::cfg_type

Definition at line 275 of file thread_client_context.hpp.

◆ eval_shared_del_t

template<class WQ , class Stats >
using jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::eval_shared_del_t = eval_shared_deleter_t<typename signalled_work_queue_type::value_type>

Definition at line 277 of file thread_client_context.hpp.

◆ no_ref_counting

template<class WQ , class Stats >
typedef signalled_work_queue_type::value_type::no_ref_counting jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::no_ref_counting

Definition at line 274 of file thread_client_context.hpp.

◆ signalled_work_queue_type

template<class WQ , class Stats >
typedef WQ jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::signalled_work_queue_type

This is a container of GSSk items from the front of the queue to implement the GSS(k) or bakers' scheduling algorithm.

Definition at line 271 of file thread_client_context.hpp.

◆ statistics_type

template<class WQ , class Stats >
typedef Stats jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::statistics_type

The statistics to be gathered by the thread_pool, by default none.

Definition at line 273 of file thread_client_context.hpp.

◆ work_complete_t

template<class WQ , class Stats >
typedef signalled_work_queue_type::value_type::value_type::work_complete_t jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::work_complete_t

Definition at line 276 of file thread_client_context.hpp.

Constructor & Destructor Documentation

◆ batch_details()

template<class WQ , class Stats >
constexpr __stdcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::batch_details ( )
inlineconstexprnoexcept

Definition at line 315 of file thread_client_context.hpp.

Member Function Documentation

◆ add_work_to_batch()

template<class WQ , class Stats >
bool __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::add_work_to_batch ( 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
wkThe closure_base-derived closure to attempt to add.
Returns
true if the closure_base-derived closure was added, false otherwise.

Definition at line 325 of file thread_client_context.hpp.

◆ batch_empty()

template<class WQ , class Stats >
bool __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::batch_empty ( ) const
inlinenoexcept
Returns
true if the batch is empty, false otherwise.

Definition at line 296 of file thread_client_context.hpp.

◆ BOOST_STATIC_ASSERT()

template<class WQ , class Stats >
jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::BOOST_STATIC_ASSERT ( signalled_work_queue_type::max_size<=  GSSk)

Make sure that the batch_size's are the same, so that when a batch is popped off the signalled_work_queue, all of the elements are copied, with none being lost, which would cause closure_base-derived closure not to be processed. Put this check in here just because I'm ultra-cautious at the moment, as it is strictly not needed, but the horizontal threading test case in dataflow_full fails with GSSk>1 as it is a poor test case.

See also
pool_aspect::GSSk

◆ process_a_batch()

template<class WQ , class Stats >
void __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::process_a_batch ( signalled_work_queue_type signalled_work_queue)
inlinenoexcept

Definition at line 343 of file thread_client_context.hpp.

◆ process_a_batch_item()

template<class WQ , class Stats >
bool __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::process_a_batch_item ( )
inlinenoexcept

Definition at line 337 of file thread_client_context.hpp.

◆ process_the_work()

template<class WQ , class Stats >
template<class UpdStats >
void FORCE_INLINE jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::process_the_work ( UpdStats &&  update_stats,
typename cfg_type::edge_annotation_t const  e_details 
)
inlineprotectednoexcept

Definition at line 309 of file thread_client_context.hpp.

◆ refill_batch()

template<class WQ , class Stats >
void __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::refill_batch ( signalled_work_queue_type signalled_work_queue)
inlinenoexcept

Definition at line 334 of file thread_client_context.hpp.

◆ reload_batch_if_empty_nochk_nosig()

template<class WQ , class Stats >
void __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::reload_batch_if_empty_nochk_nosig ( signalled_work_queue_type signalled_work_queue)
inlineprotectednoexcept

Definition at line 301 of file thread_client_context.hpp.

◆ statistics() [1/2]

template<class WQ , class Stats >
const statistics_type& __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::statistics ( ) const
inlinenoexcept

Definition at line 350 of file thread_client_context.hpp.

◆ statistics() [2/2]

template<class WQ , class Stats >
statistics_type& __fastcall jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::statistics ( )
inlinenoexcept

Definition at line 353 of file thread_client_context.hpp.

Member Data Documentation

◆ GSSk

template<class WQ , class Stats >
constexpr unsigned long jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::GSSk =1UL
staticconstexpr

Definition at line 279 of file thread_client_context.hpp.

◆ memory_access_mode

template<class WQ , class Stats >
constexpr ppd::generic_traits::memory_access_modes jmmcg::ppd::private_::batch_details< 1UL, WQ, Stats >::memory_access_mode =eval_shared_del_t::memory_access_mode
staticconstexpr

To assist in allowing compile-time computation of the algorithmic order of the threading model.

Definition at line 284 of file thread_client_context.hpp.


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