libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::ppd::private_::sequential_pool< DM, Ps, P > Class Template Reference

A specialisation for sequential "threading", i.e. everything runs on the main thread. More...

#include <thread_pool.hpp>

Classes

class  accumulate_op_processor
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  accumulate_processor
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  algo_hack_stack_t
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  algo_hack_t
 A modifier to allow joinably transferring the work to the pool. More...
 
class  count_if_t
 A modifier to allow joinably transferring the work to the pool. More...
 
class  count_t
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  create_direct
 Used by the library to implicitly generate a closure from the InpWk type. More...
 
class  execution_context_algo_stack
 
class  execution_context_stack
 This is a useful typedef to get at the execution_context. More...
 
class  find_if_t
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  find_t
 A modifier to allow joinably transferring the work to the pool. More...
 
class  max_element_t
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  merge_t
 A modifier to allow joinably transferring the work to the pool. More...
 
class  min_element_t
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  priority
 
struct  sort_t
 A modifier to allow joinably transferring the work to the pool. More...
 
struct  void_work
 

Public Types

using pool_traits_type = P
 
using pool_type = std::vector< fake_thread * >
 A hack to give us a size_type member-typedef. More...
 
using work_distribution_mode = DM
 
using signalled_work_queue_type = typename pool_traits_type::template signalled_work_queue_type< typename work_distribution_mode::queue_model >
 
using queue_size_type = typename signalled_work_queue_type::size_type
 
typedef pool_type::size_type pool_size_type
 
using statistics_type = typename pool_traits_type::template statistics_type< typename work_distribution_mode::queue_model >
 Just stub statistics - to support the interface. No actual statistics are collected. More...
 
typedef pool_traits_type::cfg_type cfg_type
 The type of the control-flow graph that will be generated at run-time, if supported. More...
 
typedef pool_traits_type::os_traits os_traits
 A useful typedef to easily get to the various OS traits. More...
 
typedef os_traits::exception_type exception_type
 
typedef os_traits::thread_traits thread_traits
 A useful typedef to easily get to the various OS specific thread-traits. More...
 
typedef thread_traits::api_params_type api_params_type
 A useful typedef to easily get to the various API details. More...
 
typedef api_params_type::priority_type priority_type
 A useful typedef to easily get to the various priorities. More...
 
typedef private_::nonjoinable_t< sequential_poolnonjoinable
 A useful typedef to easily get to the nonjoinable grammar element. More...
 
typedef private_::joinable_t< sequential_pooljoinable
 A useful typedef to easily get to the joinable grammar element. More...
 
typedef private_::nonjoinable_buff_t< sequential_poolnonjoinable_buff
 A useful typedef to easily get to the nonjoinable_buff grammar element. More...
 
typedef execution_context_stack< void_workvoid_exec_cxt
 
typedef private_::stl_functor_result_type< boolboolean_result_type
 

Public Member Functions

constexpr __stdcall sequential_pool () noexcept(true) FORCE_INLINE
 
__stdcall sequential_pool (pool_size_type sz) noexcept(true) FORCE_INLINE
 
 sequential_pool (sequential_pool const &)=delete
 
__stdcall ~sequential_pool () FORCE_INLINE
 
constexpr pool_size_type __fastcall pool_size () const noexcept(true) FORCE_INLINE
 A stub just for compatibility. Always returns "0". More...
 
const statistics_type &__fastcall statistics () const noexcept(true) FORCE_INLINE
 A stub just for compatibility. More...
 
template<class Colln , class Fn >
parallel_algorithm< algo_hack_stack_t > __fastcall FORCE_INLINE for_each (Colln const &c, Fn const &fn) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln , typename Pred >
parallel_algorithm< count_if_t< Colln, Pred > > __fastcall FORCE_INLINE count_if (Colln &c, Pred const &p) const
 
template<class Colln >
parallel_algorithm< count_t< Colln > > __fastcall FORCE_INLINE count (Colln &c, typename Colln::value_type const &v) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln , class Pred >
parallel_algorithm< find_if_t< Colln, Pred > > __fastcall FORCE_INLINE find_if (Colln const &c, Pred const &p) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln >
parallel_algorithm< find_t< Colln > > __fastcall FORCE_INLINE find (Colln const &c, typename Colln::value_type const &v) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename CollnIn , typename CollnOut , class UniOp >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE transform (CollnIn const &in, CollnOut &out, UniOp const &op) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename CollnIn1 , typename CollnIn2 , typename CollnOut , class BinOp >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE transform (CollnIn1 const &in1, CollnIn2 const &in2, CollnOut &out, BinOp const &op) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename CollnIn , typename CollnOut >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE copy (CollnIn const &in, CollnOut &out) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln , typename BinOp >
parallel_algorithm< accumulate_op_processor< Colln, BinOp > > __fastcall FORCE_INLINE accumulate (Colln const &c, typename BinOp::result_type const &v, BinOp const &binop) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln , class V >
parallel_algorithm< accumulate_processor< Colln, V > > __fastcall FORCE_INLINE accumulate (Colln const &c, V const &v) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE fill_n (Colln &c, typename Colln::size_type sz, typename Colln::value_type const &v) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE fill (Colln &c, typename Colln::value_type const &v) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename Colln >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE reverse (Colln &c) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln , class Comp >
parallel_algorithm< max_element_t< Colln, Comp > > __fastcall FORCE_INLINE max_element (Colln const &c, Comp const &comp) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename Colln >
parallel_algorithm< max_element_t< Colln, std::less< typename Colln::value_type > > > __fastcall FORCE_INLINE max_element (Colln const &c) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class Colln , class Comp >
parallel_algorithm< min_element_t< Colln, Comp > > __fastcall FORCE_INLINE min_element (Colln const &c, Comp const &comp) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename Colln >
parallel_algorithm< min_element_t< Colln, std::less< typename Colln::value_type > > > __fastcall FORCE_INLINE min_element (Colln const &c) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename Colln , class Compare >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE sort (Colln &c, Compare const &comp) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename Colln >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE sort (Colln &c) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename CollnIn1 , typename CollnIn2 , typename CollnOut , class Compare >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE merge (CollnIn1 const &in1, CollnIn2 const &in2, CollnOut &out, Compare const &comp) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<typename CollnIn1 , typename CollnIn2 , typename CollnOut >
parallel_algorithm< algo_hack_stack_t > FORCE_INLINE merge (CollnIn1 const &in1, CollnIn2 const &in2, CollnOut &out) const
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class ArgT , class UniFn >
execution_context_stack< typename private_::unary_fun_work_type< ArgT, UniFn, sequential_pool > > FORCE_INLINE unary_fun (ArgT &&a, UniFn const &op=UniFn())
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class LHSArg , class RHSArg , class BinFn >
execution_context_stack< typename private_::binary_fun_work_type< LHSArg, RHSArg, BinFn, sequential_pool > > FORCE_INLINE binary_fun (LHSArg &&lhs, RHSArg &&rhs, BinFn const &op=BinFn())
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class T >
execution_context_stack< typename private_::binary_fun_work_type< T, T, std::logical_and< bool >, sequential_pool > > FORCE_INLINE logical_and (T &&lhs, T &&rhs)
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
template<class T >
execution_context_stack< typename private_::binary_fun_work_type< T, T, std::logical_or< bool >, sequential_pool > > FORCE_INLINE logical_or (T &&lhs, T &&rhs)
 This just forwards to the STL algorithm of the same name, for compatibility with the parallel version. More...
 
nonjoinable __fastcall operator<< (nonjoinable &&nj) noexcept(true) FORCE_INLINE
 Non-joinably transfer the closure_base-derived closure into the thread_pool. More...
 
nonjoinable_buff __fastcall operator<< (nonjoinable_buff &&njb) noexcept(true) FORCE_INLINE
 Non-joinably transfer the closure_base-derived closure into the thread_pool. More...
 
joinable_t< sequential_pool > __fastcall operator<< (joinable_t< sequential_pool > &&j) noexcept(true) FORCE_INLINE
 Joinably transfer the closure_base-derived closure into the thread_pool. More...
 
cfg_typecfg () noexcept(true) FORCE_INLINE
 Access the control-flow graph, if supported. More...
 
const cfg_typecfg () const noexcept(true) FORCE_INLINE
 Access the control-flow graph, if supported. More...
 

Static Public Member Functions

static constexpr bool __fastcall pool_empty () noexcept(true) FORCE_INLINE
 A stub just for compatibility. Always returns "true". More...
 
static constexpr bool __fastcall queue_empty () noexcept(true) FORCE_INLINE
 A stub just for compatibility. Always returns "true". More...
 
static constexpr pool_size_type __fastcall queue_size () noexcept(true) FORCE_INLINE
 A stub just for compatibility. Always returns "0". More...
 
static void __fastcall queue_clear () noexcept(true) FORCE_INLINE
 A stub just for compatibility. Always returns "0". More...
 
static constexpr unsigned long __fastcall min_time (generic_traits::memory_access_modes) noexcept(true) FORCE_INLINE
 Return the theoretical minimum time in computations required to complete the current work. More...
 
template<class T >
static constexpr unsigned long __fastcall FORCE_INLINE min_time (T) noexcept(true)
 
static constexpr unsigned long __fastcall min_processors (generic_traits::memory_access_modes) noexcept(true) FORCE_INLINE
 Return the theoretical minimum number of processors required to achieve the minimum computation time required to complete the current work. More...
 
template<class T >
static constexpr unsigned long __fastcall FORCE_INLINE min_processors (T) noexcept(true)
 

Static Public Attributes

static const pool_traits::size_mode_t size_mode =Ps
 

Friends

template<class TPB >
class joinable_t
 
template<class TPB >
class nonjoinable_t
 
template<class TPB >
class nonjoinable_buff_t
 
template<template< class > class Joinability, class TPB , typename TPB::priority_type Pri>
class priority_t
 
template<class DM1 , generic_traits::return_data RD, class TPB , class Wk >
class execution_context_stack_type
 
template<class DM1 , generic_traits::return_data RD, class TPB , template< class, class, template< class > class, template< class > class > class CoreWk, class AlgoWrapT , class Wk >
class execution_context_algo_stack_type
 
template<generic_traits::return_data RD, class TPB , template< class > class Del, template< class > class AtCtr>
class horizontal_execution
 
tostream &__fastcall operator<< (tostream &os, sequential_pool const &t) FORCE_INLINE
 

Detailed Description

template<class DM, pool_traits::size_mode_t Ps, typename P>
class jmmcg::ppd::private_::sequential_pool< DM, Ps, P >

A specialisation for sequential "threading", i.e. everything runs on the main thread.

So that the use can make use of the thread library, and automatically switch between real threading and sequential mode without changing their user code apart from some simple typedefs.

Definition at line 133 of file thread_pool.hpp.

Member Typedef Documentation

◆ api_params_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef thread_traits::api_params_type jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::api_params_type

A useful typedef to easily get to the various API details.

Definition at line 158 of file thread_pool.hpp.

◆ boolean_result_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef private_::stl_functor_result_type<bool> jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::boolean_result_type

Definition at line 291 of file thread_pool.hpp.

◆ cfg_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef pool_traits_type::cfg_type jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::cfg_type

The type of the control-flow graph that will be generated at run-time, if supported.

See also
cfg(), dummy_control_flow_graph, control_flow_graph

Definition at line 151 of file thread_pool.hpp.

◆ exception_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef os_traits::exception_type jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::exception_type

Definition at line 154 of file thread_pool.hpp.

◆ joinable

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef private_::joinable_t<sequential_pool> jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::joinable

A useful typedef to easily get to the joinable grammar element.

See also
joinable_t

Definition at line 173 of file thread_pool.hpp.

◆ nonjoinable

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef private_::nonjoinable_t<sequential_pool> jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::nonjoinable

A useful typedef to easily get to the nonjoinable grammar element.

See also
nonjoinable_t

Definition at line 168 of file thread_pool.hpp.

◆ nonjoinable_buff

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef private_::nonjoinable_buff_t<sequential_pool> jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::nonjoinable_buff

A useful typedef to easily get to the nonjoinable_buff grammar element.

See also
nonjoinable_buff_t

Definition at line 178 of file thread_pool.hpp.

◆ os_traits

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef pool_traits_type::os_traits jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::os_traits

A useful typedef to easily get to the various OS traits.

Definition at line 153 of file thread_pool.hpp.

◆ pool_size_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef pool_type::size_type jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::pool_size_type

Definition at line 144 of file thread_pool.hpp.

◆ pool_traits_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
using jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::pool_traits_type = P

Definition at line 138 of file thread_pool.hpp.

◆ pool_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
using jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::pool_type = std::vector<fake_thread *>

A hack to give us a size_type member-typedef.

Definition at line 140 of file thread_pool.hpp.

◆ priority_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef api_params_type::priority_type jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::priority_type

A useful typedef to easily get to the various priorities.

Definition at line 160 of file thread_pool.hpp.

◆ queue_size_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
using jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::queue_size_type = typename signalled_work_queue_type::size_type

Definition at line 143 of file thread_pool.hpp.

◆ signalled_work_queue_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
using jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::signalled_work_queue_type = typename pool_traits_type::template signalled_work_queue_type<typename work_distribution_mode::queue_model>

Definition at line 142 of file thread_pool.hpp.

◆ statistics_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
using jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::statistics_type = typename pool_traits_type::template statistics_type<typename work_distribution_mode::queue_model>

Just stub statistics - to support the interface. No actual statistics are collected.

Definition at line 146 of file thread_pool.hpp.

◆ thread_traits

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef os_traits::thread_traits jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::thread_traits

A useful typedef to easily get to the various OS specific thread-traits.

Definition at line 156 of file thread_pool.hpp.

◆ void_exec_cxt

template<class DM, pool_traits::size_mode_t Ps, typename P>
typedef execution_context_stack<void_work> jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::void_exec_cxt

Definition at line 255 of file thread_pool.hpp.

◆ work_distribution_mode

template<class DM, pool_traits::size_mode_t Ps, typename P>
using jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::work_distribution_mode = DM

Definition at line 141 of file thread_pool.hpp.

Constructor & Destructor Documentation

◆ sequential_pool() [1/3]

template<class DM, pool_traits::size_mode_t Ps, typename P>
constexpr __stdcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::sequential_pool ( )
inlineconstexprnoexcept

Definition at line 576 of file thread_pool.hpp.

◆ sequential_pool() [2/3]

template<class DM, pool_traits::size_mode_t Ps, typename P>
__stdcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::sequential_pool ( pool_size_type  sz)
inlineexplicitnoexcept

Definition at line 579 of file thread_pool.hpp.

◆ sequential_pool() [3/3]

template<class DM, pool_traits::size_mode_t Ps, typename P>
jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::sequential_pool ( sequential_pool< DM, Ps, P > const &  )
delete

◆ ~sequential_pool()

template<class DM, pool_traits::size_mode_t Ps, typename P>
__stdcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::~sequential_pool ( )
inline

Definition at line 584 of file thread_pool.hpp.

Member Function Documentation

◆ accumulate() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln , typename BinOp >
parallel_algorithm<accumulate_op_processor<Colln, BinOp> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::accumulate ( Colln const &  c,
typename BinOp::result_type const &  v,
BinOp const &  binop 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
vThe initial value.
binopThe binary operation to use.
Returns
An execution_context that may be waited upon to determine when all of the applications of op are complete, and obtain the result.
See also
std::accumulate
execution_context

Definition at line 827 of file thread_pool.hpp.

◆ accumulate() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln , class V >
parallel_algorithm<accumulate_processor<Colln, V> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::accumulate ( Colln const &  c,
V const &  v 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
vThe initial value.
Returns
An execution_context that may be waited upon to determine when all of the applications of op are complete, and obtain the result.
See also
std::accumulate
execution_context

Definition at line 846 of file thread_pool.hpp.

◆ binary_fun()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class LHSArg , class RHSArg , class BinFn >
execution_context_stack<typename private_::binary_fun_work_type<LHSArg, RHSArg, BinFn, sequential_pool> > FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::binary_fun ( LHSArg &&  lhs,
RHSArg &&  rhs,
BinFn const &  op = BinFn() 
)
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Definition at line 1089 of file thread_pool.hpp.

◆ cfg() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
const cfg_type& jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::cfg ( ) const
inlinenoexcept

Access the control-flow graph, if supported.

Definition at line 1164 of file thread_pool.hpp.

◆ cfg() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
cfg_type& jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::cfg ( )
inlinenoexcept

Access the control-flow graph, if supported.

Definition at line 1160 of file thread_pool.hpp.

◆ copy()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename CollnIn , typename CollnOut >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::copy ( CollnIn const &  in,
CollnOut &  out 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
inA collection.
outAnother collection.
Returns
An execution_context that may be waited upon to determine when all of the applications of f are complete.
See also
std::copy

Definition at line 800 of file thread_pool.hpp.

◆ count()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln >
parallel_algorithm<count_t<Colln> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::count ( Colln &  c,
typename Colln::value_type const &  v 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
vThe value to find and be counted.
Returns
An execution_context that may be waited upon, and obtain the count.
See also
std::count
execution_context

Definition at line 684 of file thread_pool.hpp.

◆ count_if()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln , typename Pred >
parallel_algorithm<count_if_t<Colln, Pred> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::count_if ( Colln &  c,
Pred const &  p 
) const
inline
Parameters
cA collection.
pThe predicate to use to count the matching values.
Returns
An execution_context that may be waited upon to determine when all of the applications of p are complete, and obtain the count.
See also
std::count_if
execution_context

Definition at line 666 of file thread_pool.hpp.

◆ fill()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::fill ( Colln &  c,
typename Colln::value_type const &  v 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection to be filled.
vThe value used to copy into the collection.
See also
std::fill

Definition at line 882 of file thread_pool.hpp.

◆ fill_n()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::fill_n ( Colln &  c,
typename Colln::size_type  sz,
typename Colln::value_type const &  v 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection to be filled.
szThe number of items to place into the collection.
vThe value used to copy into the collection.
See also
std::fill_n

Definition at line 863 of file thread_pool.hpp.

◆ find()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln >
parallel_algorithm<find_t<Colln> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::find ( Colln const &  c,
typename Colln::value_type const &  v 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
vThe value to be found.
Returns
An execution_context that may be waited upon, and obtain a boolean indicating if the item was found.
See also
std::find
execution_context

Definition at line 721 of file thread_pool.hpp.

◆ find_if()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln , class Pred >
parallel_algorithm<find_if_t<Colln, Pred> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::find_if ( Colln const &  c,
Pred const &  p 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
pThe predicate to use to find the matching value.
Returns
An execution_context that may be waited upon to determine when all of the applications of p are complete, and obtain a boolean indicating if the item was found.
See also
std::find_if
execution_context

Definition at line 703 of file thread_pool.hpp.

◆ for_each()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln , class Fn >
parallel_algorithm<algo_hack_stack_t> __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::for_each ( Colln const &  c,
Fn const &  fn 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
fnA unary_function-type that need not be thread-safe, nor support reentrancy, but should not have side-effects, but in other respects the same as for std::for_each().
Returns
An atomic object that may be waited upon to determine when all of the applications of f are complete.
See also
std::for_each

Definition at line 647 of file thread_pool.hpp.

◆ logical_and()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class T >
execution_context_stack<typename private_::binary_fun_work_type<T, T, std::logical_and<bool>, sequential_pool> > FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::logical_and ( T &&  lhs,
T &&  rhs 
)
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Definition at line 1100 of file thread_pool.hpp.

◆ logical_or()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class T >
execution_context_stack<typename private_::binary_fun_work_type<T, T, std::logical_or<bool>, sequential_pool> > FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::logical_or ( T &&  lhs,
T &&  rhs 
)
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Definition at line 1109 of file thread_pool.hpp.

◆ max_element() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename Colln >
parallel_algorithm<max_element_t<Colln, std::less<typename Colln::value_type> > > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::max_element ( Colln const &  c) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
Returns
An execution_context that may be waited upon to obtain the result, which is the largest value in the collection, not an iterator to it.
See also
std::max_element
execution_context

Definition at line 937 of file thread_pool.hpp.

◆ max_element() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln , class Comp >
parallel_algorithm<max_element_t<Colln, Comp> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::max_element ( Colln const &  c,
Comp const &  comp 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
compThe comparator to use to compare the items.
Returns
An execution_context that may be waited upon to obtain the result, which is the largest value in the collection, not an iterator to it.
See also
std::max_element
execution_context

Definition at line 920 of file thread_pool.hpp.

◆ merge() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename CollnIn1 , typename CollnIn2 , typename CollnOut >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::merge ( CollnIn1 const &  in1,
CollnIn2 const &  in2,
CollnOut &  out 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
in1The first collection.
in2The second collection.
outAnother collection.
Returns
An execution_context that may be waited upon to determine when the merge is complete.
See also
std::merge()
execution_context

Definition at line 1066 of file thread_pool.hpp.

◆ merge() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename CollnIn1 , typename CollnIn2 , typename CollnOut , class Compare >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::merge ( CollnIn1 const &  in1,
CollnIn2 const &  in2,
CollnOut &  out,
Compare const &  comp 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
in1The first collection.
in2The second collection.
outAnother collection.
compThe comparison operator.
Returns
An execution_context that may be waited upon to determine when the merge is complete.
See also
std::merge()
execution_context

Definition at line 1032 of file thread_pool.hpp.

◆ min_element() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename Colln >
parallel_algorithm<min_element_t<Colln, std::less<typename Colln::value_type> > > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::min_element ( Colln const &  c) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
Returns
An execution_context that may be waited upon to obtain the result, which is the smallest value in the collection, not an iterator to it.
See also
std::min_element
execution_context

Definition at line 971 of file thread_pool.hpp.

◆ min_element() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class Colln , class Comp >
parallel_algorithm<min_element_t<Colln, Comp> > __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::min_element ( Colln const &  c,
Comp const &  comp 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection.
compThe comparator to use to compare the items.
Returns
An execution_context that may be waited upon to obtain the result, which is the smallest value in the collection, not an iterator to it.
See also
std::min_element
execution_context

Definition at line 954 of file thread_pool.hpp.

◆ min_processors() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
static constexpr unsigned long __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::min_processors ( generic_traits::memory_access_modes  )
inlinestaticconstexprnoexcept

Return the theoretical minimum number of processors required to achieve the minimum computation time required to complete the current work.

Definition at line 626 of file thread_pool.hpp.

◆ min_processors() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class T >
static constexpr unsigned long __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::min_processors ( )
inlinestaticconstexprnoexcept

Definition at line 631 of file thread_pool.hpp.

◆ min_time() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
static constexpr unsigned long __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::min_time ( generic_traits::memory_access_modes  )
inlinestaticconstexprnoexcept

Return the theoretical minimum time in computations required to complete the current work.

Definition at line 615 of file thread_pool.hpp.

◆ min_time() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class T >
static constexpr unsigned long __fastcall FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::min_time ( )
inlinestaticconstexprnoexcept

Definition at line 620 of file thread_pool.hpp.

◆ operator<<() [1/3]

template<class DM, pool_traits::size_mode_t Ps, typename P>
joinable_t<sequential_pool> __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::operator<< ( joinable_t< sequential_pool< DM, Ps, P > > &&  j)
inlinenoexcept

Joinably transfer the closure_base-derived closure into the thread_pool.

Todo:
JMG: Hubert Matthews suggested that potentially expression templates could be used here to concatenate the thread_wk_t's that are transferred into the pool; also as an implementation of back_batching, i.e. GSS(k) scheduling.
See also
joinable_t

Definition at line 1144 of file thread_pool.hpp.

◆ operator<<() [2/3]

template<class DM, pool_traits::size_mode_t Ps, typename P>
nonjoinable __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::operator<< ( nonjoinable &&  nj)
inlinenoexcept

Non-joinably transfer the closure_base-derived closure into the thread_pool.

Todo:
JMG: Hubert Matthews suggested that potentially expression templates could be used here to concatenate the thread_wk_t's that are transferred into the pool; also as an implementation of back_batching, i.e. GSS(k) scheduling.
See also
nonjoinable

Definition at line 1120 of file thread_pool.hpp.

◆ operator<<() [3/3]

template<class DM, pool_traits::size_mode_t Ps, typename P>
nonjoinable_buff __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::operator<< ( nonjoinable_buff &&  njb)
inlinenoexcept

Non-joinably transfer the closure_base-derived closure into the thread_pool.

Parameters
njbInitialised with a suitable buffer for allocating the internal work items into.
Todo:
JMG: Hubert Matthews suggested that potentially expression templates could be used here to concatenate the thread_wk_t's that are transferred into the pool; also as an implementation of back_batching, i.e. GSS(k) scheduling.
See also
nonjoinable_buff, algo_thread_wk_buffered

Definition at line 1133 of file thread_pool.hpp.

◆ pool_empty()

template<class DM, pool_traits::size_mode_t Ps, typename P>
static constexpr bool __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::pool_empty ( )
inlinestaticconstexprnoexcept

A stub just for compatibility. Always returns "true".

Definition at line 588 of file thread_pool.hpp.

◆ pool_size()

template<class DM, pool_traits::size_mode_t Ps, typename P>
constexpr pool_size_type __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::pool_size ( ) const
inlineconstexprnoexcept

A stub just for compatibility. Always returns "0".

Definition at line 592 of file thread_pool.hpp.

◆ queue_clear()

template<class DM, pool_traits::size_mode_t Ps, typename P>
static void __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::queue_clear ( )
inlinestaticnoexcept

A stub just for compatibility. Always returns "0".

Definition at line 605 of file thread_pool.hpp.

◆ queue_empty()

template<class DM, pool_traits::size_mode_t Ps, typename P>
static constexpr bool __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::queue_empty ( )
inlinestaticconstexprnoexcept

A stub just for compatibility. Always returns "true".

Definition at line 596 of file thread_pool.hpp.

◆ queue_size()

template<class DM, pool_traits::size_mode_t Ps, typename P>
static constexpr pool_size_type __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::queue_size ( )
inlinestaticconstexprnoexcept

A stub just for compatibility. Always returns "0".

Definition at line 600 of file thread_pool.hpp.

◆ reverse()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename Colln >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::reverse ( Colln &  c) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cA collection to be filled.
See also
std::reverse

Definition at line 899 of file thread_pool.hpp.

◆ sort() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename Colln >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::sort ( Colln &  c) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cThe collection to be sorted.
Returns
An execution_context that may be waited upon to determine when the sort is complete.
See also
std::sort()
execution_context

Definition at line 1011 of file thread_pool.hpp.

◆ sort() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename Colln , class Compare >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::sort ( Colln &  c,
Compare const &  comp 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
cThe collection to be sorted.
compThe comparison operator.
Returns
An execution_context that may be waited upon to determine when the sort is complete.
See also
std::sort()
execution_context

Definition at line 988 of file thread_pool.hpp.

◆ statistics()

template<class DM, pool_traits::size_mode_t Ps, typename P>
const statistics_type& __fastcall jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::statistics ( ) const
inlinenoexcept

A stub just for compatibility.

Definition at line 609 of file thread_pool.hpp.

◆ transform() [1/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename CollnIn , typename CollnOut , class UniOp >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::transform ( CollnIn const &  in,
CollnOut &  out,
UniOp const &  op 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
inA collection.
outAnother collection.
opThe unary operator to apply to each element of in the output placed into out.
Returns
An execution_context that may be waited upon to determine when all of the applications of op are complete.
See also
std::transform
execution_context

Definition at line 742 of file thread_pool.hpp.

◆ transform() [2/2]

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<typename CollnIn1 , typename CollnIn2 , typename CollnOut , class BinOp >
parallel_algorithm<algo_hack_stack_t> FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::transform ( CollnIn1 const &  in1,
CollnIn2 const &  in2,
CollnOut &  out,
BinOp const &  op 
) const
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Parameters
in1The first collection.
in2The second collection.
outAnother collection.
opThe unary operator to apply to each element of in the output placed into out.
Returns
An execution_context that may be waited upon to determine when all of the applications of op are complete.
See also
std::transform
execution_context

Definition at line 773 of file thread_pool.hpp.

◆ unary_fun()

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class ArgT , class UniFn >
execution_context_stack<typename private_::unary_fun_work_type<ArgT, UniFn, sequential_pool> > FORCE_INLINE jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::unary_fun ( ArgT &&  a,
UniFn const &  op = UniFn() 
)
inline

This just forwards to the STL algorithm of the same name, for compatibility with the parallel version.

Definition at line 1076 of file thread_pool.hpp.

Friends And Related Function Documentation

◆ execution_context_algo_stack_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class DM1 , generic_traits::return_data RD, class TPB , template< class, class, template< class > class, template< class > class > class CoreWk, class AlgoWrapT , class Wk >
friend class execution_context_algo_stack_type
friend

Definition at line 1174 of file thread_pool.hpp.

◆ execution_context_stack_type

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class DM1 , generic_traits::return_data RD, class TPB , class Wk >
friend class execution_context_stack_type
friend

Definition at line 1173 of file thread_pool.hpp.

◆ horizontal_execution

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<generic_traits::return_data RD, class TPB , template< class > class Del, template< class > class AtCtr>
friend class horizontal_execution
friend

Definition at line 1175 of file thread_pool.hpp.

◆ joinable_t

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class TPB >
friend class joinable_t
friend

Definition at line 1169 of file thread_pool.hpp.

◆ nonjoinable_buff_t

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class TPB >
friend class nonjoinable_buff_t
friend

Definition at line 1171 of file thread_pool.hpp.

◆ nonjoinable_t

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<class TPB >
friend class nonjoinable_t
friend

Definition at line 1170 of file thread_pool.hpp.

◆ operator<<

template<class DM, pool_traits::size_mode_t Ps, typename P>
tostream& __fastcall operator<< ( tostream os,
sequential_pool< DM, Ps, P > const &  t 
)
friend
Todo:
Implement using the advice given in "Standard C++ IOStreams and Locales" by A.Langer & K.Kreft, page 170.

Definition at line 1152 of file thread_pool.hpp.

◆ priority_t

template<class DM, pool_traits::size_mode_t Ps, typename P>
template<template< class > class Joinability, class TPB , typename TPB::priority_type Pri>
friend class priority_t
friend

Definition at line 1172 of file thread_pool.hpp.

Member Data Documentation

◆ size_mode

template<class DM, pool_traits::size_mode_t Ps, typename P>
const pool_traits::size_mode_t jmmcg::ppd::private_::sequential_pool< DM, Ps, P >::size_mode =Ps
static

Definition at line 162 of file thread_pool.hpp.


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