CUBRID Engine  latest
cubthread::worker_pool< Context >::core Class Reference

#include <thread_worker_pool.hpp>

Collaboration diagram for cubthread::worker_pool< Context >::core:
Collaboration graph

Classes

class  worker
 

Public Types

using context_type = Context
 
using task_type = task< Context >
 
using worker_pool_type = worker_pool< Context >
 

Public Member Functions

void init_pool_and_workers (worker_pool< Context > &parent, std::size_t worker_count)
 
void execute_task (task_type *task_p)
 
template<typename Func , typename... Args>
void map_running_contexts (bool &stop, Func &&func, Args &&...args) const
 
void notify_stop (bool &is_not_stopped)
 
void retire_queued_tasks (void)
 
void start_all_workers (void)
 
void get_stats (cubperf::stat_value *sum_inout) const
 
void finished_task_notification (void)
 
task_typeget_task_or_become_available (worker &worker_arg)
 
void become_available (worker &worker_arg)
 
void check_worker_not_available (const worker &worker_arg)
 
context_manager< context_type > & get_context_manager (void)
 
std::size_t get_max_worker_count (void) const
 
worker_pool_typeget_parent_pool (void) const
 

Private Member Functions

 core ()
 
 ~core (void)
 

Private Attributes

friend worker_pool
 
worker_pool_typem_parent_pool
 
std::size_t m_max_workers
 
workerm_worker_array
 
worker ** m_available_workers
 
std::size_t m_available_count
 
std::queue< task_type * > m_task_queue
 
std::mutex m_workers_mutex
 

Detailed Description

template<typename Context>
class cubthread::worker_pool< Context >::core

Definition at line 272 of file thread_worker_pool.hpp.

Member Typedef Documentation

template<typename Context>
using cubthread::worker_pool< Context >::core::context_type = Context

Definition at line 275 of file thread_worker_pool.hpp.

template<typename Context>
using cubthread::worker_pool< Context >::core::task_type = task<Context>

Definition at line 276 of file thread_worker_pool.hpp.

template<typename Context>
using cubthread::worker_pool< Context >::core::worker_pool_type = worker_pool<Context>

Definition at line 277 of file thread_worker_pool.hpp.

Constructor & Destructor Documentation

template<typename Context >
cubthread::worker_pool< Context >::core::core ( )
private

Definition at line 837 of file thread_worker_pool.hpp.

template<typename Context >
cubthread::worker_pool< Context >::core::~core ( void  )
private

Member Function Documentation

template<typename Context >
void cubthread::worker_pool< Context >::core::finished_task_notification ( void  )
template<typename Context >
context_manager< typename worker_pool< Context >::core::context_type > & cubthread::worker_pool< Context >::core::get_context_manager ( void  )
template<typename Context >
std::size_t cubthread::worker_pool< Context >::core::get_max_worker_count ( void  ) const

Definition at line 986 of file thread_worker_pool.hpp.

References cubthread::worker_pool< Context >::core::m_max_workers.

Referenced by css_wp_core_job_scan_mapper().

Here is the caller graph for this function:

template<typename Context>
worker_pool_type* cubthread::worker_pool< Context >::core::get_parent_pool ( void  ) const
inline

Definition at line 317 of file thread_worker_pool.hpp.

template<typename Context >
void cubthread::worker_pool< Context >::core::get_stats ( cubperf::stat_value sum_inout) const
template<typename Context >
template<typename Func , typename... Args>
void cubthread::worker_pool< Context >::core::map_running_contexts ( bool stop,
Func &&  func,
Args &&...  args 
) const
template<typename Context >
void cubthread::worker_pool< Context >::core::notify_stop ( bool is_not_stopped)
template<typename Context >
void cubthread::worker_pool< Context >::core::retire_queued_tasks ( void  )

Member Data Documentation

template<typename Context>
friend cubthread::worker_pool< Context >::core::worker_pool
private

Definition at line 324 of file thread_worker_pool.hpp.


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