libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB > Class Template Reference

A modifier to allow non-joinably transferring the work to the pool. More...

#include <thread_dsel_types.hpp>

Inheritance diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >:
[legend]

Public Types

typedef TPB thread_pool_type
 
typedef thread_pool_type::pool_traits_type pool_traits_type
 
typedef thread_pool_type::os_traits os_traits
 
typedef thread_pool_type::priority_type priority_type
 

Public Member Functions

constexpr nonjoinable_t (const cliques::element_type c=1) noexcept(true) FORCE_INLINE
 
template<class T >
constexpr FORCE_INLINE nonjoinable_t (T const *parent, typename pool_traits_type::thread_wk_elem_type::cfg_type::node_property_t::value_type const details[], const cliques::element_type c=1) noexcept(true)
 
constexpr nonjoinable_t (thread_pool_type &p, const cliques::element_type c, typename pool_traits_type::thread_wk_elem_type::cfg_details_type::params const &cfg_p) noexcept(true) FORCE_INLINE
 
constexpr nonjoinable_t (nonjoinable_t const &nj, thread_pool_type &p) noexcept(true) FORCE_INLINE
 
template<class InpWk >
thread_pool_type &__fastcall FORCE_INLINE push_back (InpWk &&wk) noexcept(false)
 Transfer the closure_base-derived closure into the thread_pool, non-joinably. More...
 
template<class Alg >
thread_pool_type &__fastcall FORCE_INLINE push_back (parallel_algorithm< Alg > &&wk) noexcept(false)
 
template<class R , class F , class L >
thread_pool_type &__fastcall FORCE_INLINE operator<< (boost::_bi::bind_t< R, F, L > &&wk) noexcept(false)
 
template<template< class, class, class > class B, class R , class F , class L , class Test = typename std::enable_if<std::is_bind_expression<B<R, F, L>>::value>::type>
thread_pool_type &__fastcall FORCE_INLINE operator<< (B< R, F, L > &&wk) noexcept(false)
 
template<class InpWk >
thread_pool_type &__fastcall FORCE_INLINE operator<< (InpWk &&wk) noexcept(false)
 
template<class Alg >
thread_pool_type &__fastcall FORCE_INLINE operator<< (parallel_algorithm< Alg > &&wk) noexcept(false)
 
template<typename thread_pool_type::priority_type Pri>
priority_t< nonjoinable_t, TPB, Pri > __fastcall FORCE_INLINE operator<< (typename thread_pool_type::template priority< Pri >) noexcept(true)
 Non-joinably transfer the closure_base-derived closure, which will be process()ed at the specified priority. More...
 
cliques_t< nonjoinable_t > __fastcall operator<< (cliques &&c) noexcept(true) FORCE_INLINE
 Non-joinably transfer the closure_base-derived closure, using a sub-set of the pool_threads within the thread_pool. More...
 

Static Public Attributes

static constexpr generic_traits::return_data result_traits_ =generic_traits::return_data::nonjoinable
 

Detailed Description

template<class TPB>
class jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >

A modifier to allow non-joinably transferring the work to the pool.

Definition at line 779 of file thread_dsel_types.hpp.

Member Typedef Documentation

◆ os_traits

template<class TPB >
typedef thread_pool_type::os_traits jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::os_traits

Definition at line 783 of file thread_dsel_types.hpp.

◆ pool_traits_type

template<class TPB >
typedef thread_pool_type::pool_traits_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::pool_traits_type

Definition at line 782 of file thread_dsel_types.hpp.

◆ priority_type

template<class TPB >
typedef thread_pool_type::priority_type jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::priority_type

Definition at line 784 of file thread_dsel_types.hpp.

◆ thread_pool_type

Definition at line 781 of file thread_dsel_types.hpp.

Constructor & Destructor Documentation

◆ nonjoinable_t() [1/4]

template<class TPB >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::nonjoinable_t ( const cliques::element_type  c = 1)
inlineconstexprnoexcept

Definition at line 788 of file thread_dsel_types.hpp.

◆ nonjoinable_t() [2/4]

template<class TPB >
template<class T >
constexpr FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::nonjoinable_t ( T const *  parent,
typename pool_traits_type::thread_wk_elem_type::cfg_type::node_property_t::value_type const  details[],
const cliques::element_type  c = 1 
)
inlineconstexprnoexcept

Definition at line 792 of file thread_dsel_types.hpp.

◆ nonjoinable_t() [3/4]

template<class TPB >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::nonjoinable_t ( thread_pool_type p,
const cliques::element_type  c,
typename pool_traits_type::thread_wk_elem_type::cfg_details_type::params const &  cfg_p 
)
inlineconstexprnoexcept

Definition at line 795 of file thread_dsel_types.hpp.

◆ nonjoinable_t() [4/4]

template<class TPB >
constexpr jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::nonjoinable_t ( nonjoinable_t< TPB > const &  nj,
thread_pool_type p 
)
inlineconstexprnoexcept

Definition at line 798 of file thread_dsel_types.hpp.

Member Function Documentation

◆ operator<<() [1/6]

template<class TPB >
template<template< class, class, class > class B, class R , class F , class L , class Test = typename std::enable_if<std::is_bind_expression<B<R, F, L>>::value>::type>
thread_pool_type& __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::operator<< ( B< R, F, L > &&  wk)
inlinenoexcept

Definition at line 852 of file thread_dsel_types.hpp.

◆ operator<<() [2/6]

template<class TPB >
template<class R , class F , class L >
thread_pool_type& __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::operator<< ( boost::_bi::bind_t< R, F, L > &&  wk)
inlinenoexcept

Definition at line 840 of file thread_dsel_types.hpp.

◆ operator<<() [3/6]

template<class TPB >
cliques_t<nonjoinable_t> __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::operator<< ( cliques &&  c)
inlinenoexcept

Non-joinably transfer the closure_base-derived closure, using a sub-set of the pool_threads within the thread_pool.

Parameters
cThe number of cliques into which the thread_pool should be divided.
See also
cliques, cliques_t

Definition at line 888 of file thread_dsel_types.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::sequential_pool< DM, Ps, P >::nonjoinable_t, and jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::cliques::number.

◆ operator<<() [4/6]

template<class TPB >
template<class InpWk >
thread_pool_type& __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::operator<< ( InpWk &&  wk)
inlinenoexcept

Definition at line 858 of file thread_dsel_types.hpp.

◆ operator<<() [5/6]

template<class TPB >
template<class Alg >
thread_pool_type& __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::operator<< ( parallel_algorithm< Alg > &&  wk)
inlinenoexcept

Definition at line 863 of file thread_dsel_types.hpp.

◆ operator<<() [6/6]

template<class TPB >
template<typename thread_pool_type::priority_type Pri>
priority_t<nonjoinable_t, TPB, Pri> __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::operator<< ( typename thread_pool_type::template priority< Pri >  )
inlinenoexcept

Non-joinably transfer the closure_base-derived closure, which will be process()ed at the specified priority.

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
priority, priority_t

Definition at line 877 of file thread_dsel_types.hpp.

◆ push_back() [1/2]

template<class TPB >
template<class InpWk >
thread_pool_type& __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::push_back ( InpWk &&  wk)
inlinenoexcept

Transfer the closure_base-derived closure into the thread_pool, non-joinably.

No need to verify that the closure_base-derived closure has not been previously transferred.

This operation requires at most 1 memory allocation.

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.
Parameters
wkThe closure_base-derived closure to be asynchronously executed, that must be copy-constructible. The result_type is inferred from the process(result_type &) or process() member-functions declared in the Wk type. Note that the process() member-function must not be overloaded, or this will not work, also that it must use the __fastcall calling-convention on those platforms that support it. The default mutator function is called process(), but you could provide an alternative member-function name if desired, as long as the signature is correct via the declaration of create_direct.
Returns
A reference to the pool to allow chaining.
See also
create_direct

Definition at line 817 of file thread_dsel_types.hpp.

References jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::result_traits_.

◆ push_back() [2/2]

template<class TPB >
template<class Alg >
thread_pool_type& __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::private_::nonjoinable_t< TPB >::push_back ( parallel_algorithm< Alg > &&  wk)
inlinenoexcept

This operation requires at most 2 memory allocations, in addition to those required for the operation of the parallel algorithm.

Definition at line 835 of file thread_dsel_types.hpp.

Member Data Documentation

◆ result_traits_


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