Enforce a sequential-consistency memory-model on the result data that this object manages, via the accessors to the result data, but also allow horizontal threading: if the object being managed has not yet had its result computed, and the queue in the thread_pool is not empty, process an item from that queue in the mean-time.
More...
|
typedef execution_context_algo_stack_type< pool_traits::work_distribution_mode_t::one_thread_distributes<>, generic_traits::return_data::joinable, TPB, CoreWk, AlgoWrapT, Wk > | base_t |
|
typedef horizontal_execution< generic_traits::return_data::joinable, TPB, noop_dtor, TPB::os_traits::lock_traits::template noop_atomic_ctr > | base2_t |
|
typedef base_t::thread_pool_type | thread_pool_type |
|
typedef thread_pool_type::pool_traits_type | pool_traits_type |
| The pool traits. More...
|
|
typedef thread_pool_type::os_traits | os_traits |
|
typedef thread_pool_type::pool_type | pool_type |
|
typedef os_traits::lock_traits::anon_event_type | atomic_t |
|
typedef os_traits::exception_type | exception_type |
|
typedef base_t::thread_wk_t | thread_wk_t |
|
typedef eraseable_execution_context_base< TPB, noop_dtor, TPB::os_traits::lock_traits::template noop_atomic_ctr > | base_t |
|
typedef base_t::thread_pool_type | thread_pool_type |
|
typedef base_t::pool_traits_type | pool_traits_type |
|
typedef base_t::os_traits | os_traits |
|
typedef base_t::pool_type | pool_type |
|
typedef base_t::atomic_t | atomic_t |
|
typedef base_t::exception_type | exception_type |
|
typedef thread_pool_type::template create_direct< Wk > | creator_t |
|
typedef creator_t::result_type | result_type |
|
typedef AlgoWrapT | alg_wrap_t |
|
typedef stack_exec_ctx_helper::thread_wk_t | thread_wk_t |
|
typedef thread_wk_t::work_complete_t | work_complete_t |
|
typedef horizontal_execution_itf< generic_traits::return_data::joinable, TPB, noop_dtor, TPB::os_traits::lock_traits::template noop_atomic_ctr > | base_t |
|
typedef base_t::thread_pool_type | thread_pool_type |
|
typedef base_t::pool_traits_type | pool_traits_type |
| The pool traits. More...
|
|
typedef base_t::os_traits | os_traits |
|
typedef base_t::pool_type | pool_type |
|
typedef base_t::atomic_t | atomic_t |
|
typedef base_t::exception_type | exception_type |
|
typedef base_t::thread_wk_t | thread_wk_t |
|
using | signalled_work_queue_type = typename pool_traits_type::template signalled_work_queue_type< typename thread_pool_type::work_distribution_mode::queue_model > |
|
typedef TPB | thread_pool_type |
|
typedef thread_pool_type::pool_traits_type | pool_traits_type |
| The pool traits. More...
|
|
typedef thread_pool_type::os_traits | os_traits |
|
typedef thread_pool_type::pool_type | pool_type |
|
typedef os_traits::lock_traits::anon_event_type | atomic_t |
|
typedef os_traits::exception_type | exception_type |
|
typedef closure::thread_wk_async_t< RD, os_traits, noop_dtor, TPB::os_traits::lock_traits::template noop_atomic_ctr, typename pool_traits_type::cfg_type > | thread_wk_t |
|
typedef thread_wk_t::work_complete_t | work_complete_t |
| This atomic object is the object that is used to signal to a waiting future that the work has been completed. More...
|
|
typedef TPB | thread_pool_type |
|
typedef thread_pool_type::pool_traits_type | pool_traits_type |
| The pool traits. More...
|
|
typedef thread_pool_type::os_traits | os_traits |
|
typedef thread_pool_type::pool_type | pool_type |
|
typedef os_traits::lock_traits::anon_event_type | atomic_t |
|
typedef os_traits::exception_type | exception_type |
|
typedef closure::thread_wk_async_t< RD, os_traits, noop_dtor, TPB::os_traits::lock_traits::template noop_atomic_ctr, typename pool_traits_type::cfg_type > | thread_wk_t |
|
typedef thread_wk_t::work_complete_t | work_complete_t |
| This atomic object is the object that is used to signal to a waiting future that the work has been completed. More...
|
|
|
| execution_context_algo_stack_type (thread_pool_type &pool, typename thread_wk_t::cfg_details_type::params const &p, typename thread_wk_t::closure_t::argument_type &&tw, typename thread_wk_t::work_complete_t::num_tasks_spawned_t::value_type const i, typename thread_wk_t::work_complete_t::containers_type const &c, const typename thread_pool_type::pool_type::size_type clique) noexcept(false) FORCE_INLINE |
|
| execution_context_algo_stack_type (thread_pool_type &pool, typename thread_wk_t::cfg_details_type::params const &p, typename thread_wk_t::closure_t::argument_type &&tw, typename thread_wk_t::work_complete_t::num_tasks_spawned_t::value_type const i, typename thread_wk_t::work_complete_t::containers_type const &c, const typename thread_pool_type::pool_type::size_type clique, typename thread_wk_t::work_complete_t::containers_type::size_type const out_colln_size) noexcept(false) FORCE_INLINE |
|
| execution_context_algo_stack_type (execution_context_algo_stack_type const &) |
|
| execution_context_algo_stack_type (execution_context_algo_stack_type &&) |
|
| ~execution_context_algo_stack_type () FORCE_INLINE |
|
void | operator= (execution_context_algo_stack_type const &)=delete |
|
void | operator= (execution_context_algo_stack_type &&)=delete |
|
| execution_context_algo_stack_type (thread_pool_type &, typename thread_wk_t::cfg_details_type::params const &p, typename thread_wk_t::closure_t::argument_type &&tw, typename work_complete_t::num_tasks_spawned_t::value_type const i, typename work_complete_t::containers_type const &c, const typename thread_pool_type::pool_type::size_type clique) noexcept(false) FORCE_INLINE |
|
| execution_context_algo_stack_type (thread_pool_type &, typename thread_wk_t::cfg_details_type::params const &p, typename thread_wk_t::closure_t::argument_type &&tw, typename work_complete_t::num_tasks_spawned_t::value_type const i, typename work_complete_t::containers_type const &c, const typename thread_pool_type::pool_type::size_type clique, typename work_complete_t::containers_type::size_type const out_colln_size) noexcept(false) FORCE_INLINE |
|
| execution_context_algo_stack_type (execution_context_algo_stack_type const &) |
|
| execution_context_algo_stack_type (execution_context_algo_stack_type &&) |
|
| ~execution_context_algo_stack_type () noexcept(false) FORCE_INLINE |
|
void | operator& ()=delete |
| Can't automatically convert to a base-class address automatically - to maintain the concept that this is a stack allocated object. More...
|
|
template<class T > |
| operator T () const =delete |
| Attempt to remove the ability to subvert the safety by incorrectly casting the execution_context. More...
|
|
template<class T > |
| operator T ()=delete |
| Attempt to remove the ability to subvert the safety by incorrectly casting the execution_context. More...
|
|
void | operator= (execution_context_algo_stack_type const &)=delete |
|
void | operator= (execution_context_algo_stack_type &&)=delete |
|
add_ref_if_not_void< result_type const >::type __fastcall | operator* () const noexcept(false) FORCE_INLINE |
| A (potentially blocking) access to the results, but only after they are written. More...
|
|
add_ref_if_not_void< result_type >::type __fastcall | operator* () noexcept(false) FORCE_INLINE |
| A (potentially blocking) access to the results, but only after they are written. More...
|
|
const result_type *__fastcall | operator-> () const noexcept(false) FORCE_INLINE |
| A (potentially blocking) access to the results, but only after they are written, or process other work from the signalled_work_queue or batch whilst wait for the core_work to be processed. More...
|
|
result_type *__fastcall | operator-> () noexcept(false) FORCE_INLINE |
| A (potentially blocking) access to the results, but only after they are written, or process other work from the signalled_work_queue or batch whilst wait for the core_work to be processed. More...
|
|
const execution_context_algo_stack_type *__fastcall | operator& () const noexcept(true) override FORCE_INLINE |
| Ensure that if an execution context is passed to another function, only a constant version may be passed. More...
|
|
bool __fastcall | erase () noexcept(false) FORCE_INLINE |
| Erase the thread_wk_t item from the queue in the thread_pool, if it is still in there. More...
|
|
| horizontal_execution_itf (horizontal_execution_itf const &)=delete |
|
| horizontal_execution_itf (horizontal_execution_itf const &)=delete |
|
template<class TPB, template< class, class, template< class > class, template< class > class > class CoreWk, class AlgoWrapT, class Wk>
class jmmcg::ppd::private_::execution_context_algo_stack_type< pool_traits::work_distribution_mode_t::worker_threads_get_work< typename TPB::work_distribution_mode::queue_model >, generic_traits::return_data::joinable, TPB, CoreWk, AlgoWrapT, Wk >
Enforce a sequential-consistency memory-model on the result data that this object manages, via the accessors to the result data, but also allow horizontal threading: if the object being managed has not yet had its result computed, and the queue in the thread_pool is not empty, process an item from that queue in the mean-time.
This ensures that resource starvation (of threads) cannot occur, as no longer does waiting upon a dereference of an execution context block that thread, as that thread can process other work in the mean-time, which is important for finite-sized thread_pools. This specialisation performs horizontal threading, and the horizontal thread is also created on the stack, so with cache locality and all, quite good at stealing work. The execution_context stores the algo_thread_wk inside it, so it is allocated on the stack, not on the heap, which is only useful for classic, joinable, data-flow operations. This optimisation saves allocating the algo_thread_wk on the heap, and also the shared_ptr in it can have a dummy sp_counter_type, because the counter doesn't do anything, for a greater saving on atomic operations.
- See also
- horizontal_execution
Definition at line 1319 of file thread_client_context.hpp.