libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::ppd::pool::private_::thread_types::steal< generic_traits::return_data::joinable, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT, pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue > Class Template Referencefinal

#include <pool_thread.hpp>

Inheritance diagram for jmmcg::ppd::pool::private_::thread_types::steal< generic_traits::return_data::joinable, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT, pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >:
[legend]
Collaboration diagram for jmmcg::ppd::pool::private_::thread_types::steal< generic_traits::return_data::joinable, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT, pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >:
[legend]

Public Types

using queue_model = pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue
 
using base_t = pool_thread< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, typename PTT::template pool_thread_queue_details< queue_model >::exit_requested_type >
 
using os_traits = typename base_t::os_traits
 
using model_type = typename os_traits::thread_traits::model_type
 
using lock_traits = typename os_traits::lock_traits
 
using thread_traits = typename os_traits::thread_traits
 
using batch_type = typename PTT::template pool_thread_queue_details< queue_model >
 
using statistics_type = typename batch_type::statistics_type
 
using signalled_work_queue_type = typename batch_type::container_type
 
using exit_requested_type = typename base_t::exit_requested_type
 
- Public Types inherited from jmmcg::ppd::pool::private_::pool_thread< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT::template pool_thread_queue_details< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >::exit_requested_type >
using base_t = ppd::private_::thread_base< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::api_params_type::api_type, typename thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type >
 
using os_traits = thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >
 
using model_type = typename thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type
 
using exit_requested_type = PTT::template pool_thread_queue_details< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >::exit_requested_type
 The exit event type. More...
 
- Public Types inherited from jmmcg::ppd::private_::thread_base< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::api_params_type::api_type, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type >
typedef thread_os_traits< API, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_typeos_traits
 
typedef os_traits::thread_traits thread_traits
 
typedef os_traits::lock_traits lock_traits
 
typedef os_traits::exception_type exception_type
 

Public Member Functions

__stdcall steal (exit_requested_type &, signalled_work_queue_type &) noexcept(true) FORCE_INLINE
 
 ~steal () noexcept(false) FORCE_INLINE
 
bool __fastcall add_work_to_batch (typename signalled_work_queue_type::value_type &&wk) FORCE_INLINE
 
bool __fastcall process_a_batch_item (typename os_traits::thread_exception const &exception_thrown_in_thread) FORCE_INLINE
 
const statistics_type &__fastcall FORCE_INLINE statistics () const noexcept(true)
 
- Public Member Functions inherited from jmmcg::ppd::pool::private_::pool_thread< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT::template pool_thread_queue_details< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >::exit_requested_type >
 ~pool_thread () noexcept(false) FORCE_INLINE
 
const tstring __fastcall to_string () const noexcept(false) override final
 
- Public Member Functions inherited from jmmcg::ppd::private_::thread_base< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::api_params_type::api_type, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type >
virtual void __fastcall create_running () noexcept(false) FORCE_INLINE
 Start the underlying kernel thread. More...
 
const thread_traits::api_params_type &__fastcall params () const noexcept(true) FORCE_INLINE
 
const thread_traits::api_params_type::suspend_count __fastcall suspend () noexcept(true) FORCE_INLINE
 
const thread_base< generic_traits::MS_Win32, heavyweight_threading >::thread_traits::api_params_type::suspend_count __fastcall suspend () noexcept(true)
 
const thread_traits::api_params_type::suspend_count __fastcall resume () noexcept(true) FORCE_INLINE
 
const thread_traits::api_params_type::states __fastcall state () const noexcept(true) FORCE_INLINE
 
bool __fastcall is_running () const noexcept(true) FORCE_INLINE
 
thread_traits::api_params_type::priority_type __fastcall kernel_priority () const noexcept(false) FORCE_INLINE
 
void __fastcall kernel_priority (const typename thread_traits::api_params_type::priority_type priority) noexcept(false) FORCE_INLINE
 
thread_traits::api_params_type::processor_mask_type __fastcall kernel_affinity () const noexcept(false) FORCE_INLINE
 
void __fastcall kernel_affinity (const typename thread_traits::api_params_type::processor_mask_type &mask) noexcept(false) FORCE_INLINE
 

Static Public Attributes

static constexpr generic_traits::return_data result_traits_ =generic_traits::return_data::joinable
 
- Static Public Attributes inherited from jmmcg::ppd::pool::private_::pool_thread< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT::template pool_thread_queue_details< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >::exit_requested_type >
static constexpr generic_traits::api_type api_type
 
- Static Public Attributes inherited from jmmcg::ppd::private_::thread_base< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::api_params_type::api_type, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type >
static constexpr ppd::generic_traits::memory_access_modes memory_access_mode
 

Additional Inherited Members

- Public Attributes inherited from jmmcg::ppd::private_::thread_base< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::api_params_type::api_type, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type >
const thread_traits::api_params_type::suspend_period_ms exit_wait_period
 
- Protected Member Functions inherited from jmmcg::ppd::pool::private_::pool_thread< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT::template pool_thread_queue_details< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >::exit_requested_type >
__stdcall pool_thread (exit_requested_type &exit_r, const typename os_traits::thread_traits::api_params_type::suspend_period_ms exit_wait_p=50) noexcept(false) FORCE_INLINE
 
- Protected Member Functions inherited from jmmcg::ppd::private_::thread_base< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::api_params_type::api_type, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type >
__stdcall thread_base (const typename thread_traits::api_params_type::suspend_period_ms exit_wait_p) noexcept(false) FORCE_INLINE
 Create the wrapper object. Note that the underlying kernel thread will not have been started. More...
 
__stdcall thread_base (const thread_base &tb) noexcept(true) FORCE_INLINE
 
virtual __stdcall ~thread_base () noexcept(false) FORCE_INLINE
 Thread base dtor. More...
 
void __fastcall wait_thread_exit () noexcept(false) FORCE_INLINE
 
- Protected Attributes inherited from jmmcg::ppd::pool::private_::pool_thread< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT::template pool_thread_queue_details< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >::exit_requested_type >
exit_requested_typeexit_requested_
 This event is used by the pool to request that all thread members of the pool should exit. More...
 
- Protected Attributes inherited from jmmcg::ppd::private_::thread_base< thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::api_params_type::api_type, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading > ::thread_traits::model_type >
os_traits::thread_exception exception_thrown_in_thread
 This is to allow exceptions thrown in the contained thread to be (hopefully) propagated back to another thread on which that exception can be caught & handled. More...
 
lock_traits::critical_section_type thread_params_lock
 
thread_traits::api_params_type thread_params
 

Detailed Description

template<class PTT>
class jmmcg::ppd::pool::private_::thread_types::steal< generic_traits::return_data::joinable, thread_os_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >, PTT, pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >

You can report back exceptions from this thread wrapper type. Oh - and make sure you construct the execution_context too (because you get the exceptions through that type).

Definition at line 308 of file pool_thread.hpp.

Member Typedef Documentation

◆ base_t

◆ batch_type

◆ exit_requested_type

◆ lock_traits

◆ model_type

◆ os_traits

◆ queue_model

◆ signalled_work_queue_type

◆ statistics_type

◆ thread_traits

Constructor & Destructor Documentation

◆ steal()

◆ ~steal()

Member Function Documentation

◆ add_work_to_batch()

◆ process_a_batch_item()

Definition at line 202 of file pool_thread_impl.hpp.

◆ statistics()

Member Data Documentation

◆ result_traits_


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