CUBRID Engine
latest
|
#include <thread_daemon.hpp>
Public Member Functions | |
template<typename Context > | |
daemon (const looper &loop_pattern_arg, context_manager< Context > *context_manager_arg, task< Context > *exec, const char *name) | |
daemon (const looper &loop_pattern_arg, task_without_context *exec_arg, const char *name) | |
~daemon () | |
void | wakeup (void) |
void | stop_execution (void) |
bool | was_woken_up (void) |
void | reset_looper (void) |
void | get_stats (cubperf::stat_value *stats_out) |
bool | is_running (void) |
Static Public Member Functions | |
static std::size_t | get_stats_value_count (void) |
static const char * | get_stat_name (std::size_t stat_index) |
Private Member Functions | |
void | pause (void) |
void | register_stat_start (void) |
void | register_stat_pause (void) |
void | register_stat_execute (void) |
Static Private Member Functions | |
template<typename Context > | |
static void | loop_with_context (daemon *daemon_arg, context_manager< Context > *context_manager_arg, task< Context > *exec_arg, const char *name) |
static void | loop_without_context (daemon *daemon_arg, task_without_context *exec_arg, const char *name) |
static cubperf::statset & | create_statset (void) |
Private Attributes | |
waiter | m_waiter |
looper | m_looper |
std::function< void(void)> | m_func_on_stop |
std::thread | m_thread |
std::string | m_name |
cubperf::statset & | m_stats |
Definition at line 77 of file thread_daemon.hpp.
cubthread::daemon::daemon | ( | const looper & | loop_pattern_arg, |
context_manager< Context > * | context_manager_arg, | ||
task< Context > * | exec, | ||
const char * | name | ||
) |
Definition at line 150 of file thread_daemon.hpp.
cubthread::daemon::daemon | ( | const looper & | loop_pattern_arg, |
task_without_context * | exec_arg, | ||
const char * | name | ||
) |
Definition at line 51 of file thread_daemon.cpp.
References loop_without_context(), m_name, and m_thread.
cubthread::daemon::~daemon | ( | ) |
Definition at line 62 of file thread_daemon.cpp.
References m_stats, and stop_execution().
|
staticprivate |
Definition at line 178 of file thread_daemon.cpp.
References cubperf::statset_definition::create_statset().
|
static |
Definition at line 148 of file thread_daemon.cpp.
References assert, cubthread::waiter::get_stat_name(), cubthread::looper::get_stat_name(), cubthread::waiter::get_stats_value_count(), get_stats_value_count(), cubthread::looper::get_stats_value_count(), cubperf::statset_definition::get_value_count(), and cubperf::statset_definition::get_value_name().
Referenced by perfmon_per_daemon_stat_count().
void cubthread::daemon::get_stats | ( | cubperf::stat_value * | stats_out | ) |
Definition at line 118 of file thread_daemon.cpp.
References cubperf::statset_definition::get_stat_values_with_converted_timers(), cubthread::waiter::get_stats(), cubthread::looper::get_stats(), cubthread::looper::get_stats_value_count(), cubperf::statset_definition::get_value_count(), i, m_looper, m_stats, and m_waiter.
Referenced by lock_initialize(), log_is_log_flush_daemon_available(), and pgbuf_daemons_get_stats().
|
static |
Definition at line 142 of file thread_daemon.cpp.
References cubthread::waiter::get_stats_value_count(), cubthread::looper::get_stats_value_count(), and cubperf::statset_definition::get_value_count().
Referenced by get_stat_name(), perfmon_per_daemon_stat_count(), and pgbuf_daemons_get_stats().
bool cubthread::daemon::is_running | ( | void | ) |
Definition at line 136 of file thread_daemon.cpp.
References cubthread::waiter::is_running(), and m_waiter.
Referenced by dwb_file_sync_helper_daemon_is_running().
|
staticprivate |
Definition at line 165 of file thread_daemon.hpp.
References cubthread::context_manager< Context >::create_context(), cubthread::task< Context >::execute(), cubthread::looper::is_stopped(), m_func_on_stop, m_looper, pause(), register_stat_execute(), register_stat_pause(), register_stat_start(), cubthread::task< Context >::retire(), and cubthread::context_manager< Context >::retire_context().
|
staticprivate |
Definition at line 202 of file thread_daemon.cpp.
References cubthread::task< void >::execute(), cubthread::looper::is_stopped(), m_looper, pause(), register_stat_execute(), register_stat_pause(), register_stat_start(), and cubthread::task< void >::retire().
Referenced by daemon().
|
private |
Definition at line 100 of file thread_daemon.cpp.
References m_looper, m_waiter, and cubthread::looper::put_to_sleep().
Referenced by loop_with_context(), and loop_without_context().
|
private |
Definition at line 196 of file thread_daemon.cpp.
References m_stats, and cubperf::statset_definition::time_and_increment().
Referenced by loop_with_context(), and loop_without_context().
|
private |
Definition at line 190 of file thread_daemon.cpp.
References m_stats, and cubperf::statset_definition::time().
Referenced by loop_with_context(), and loop_without_context().
|
private |
Definition at line 184 of file thread_daemon.cpp.
References m_stats, cubperf::generic_statset< IsAtomic >::m_timept, and cubperf::reset_timept().
Referenced by loop_with_context(), and loop_without_context().
void cubthread::daemon::reset_looper | ( | void | ) |
Definition at line 112 of file thread_daemon.cpp.
References m_looper, and cubthread::looper::reset().
Referenced by pgbuf_get_page_flush_interval().
void cubthread::daemon::stop_execution | ( | void | ) |
Definition at line 77 of file thread_daemon.cpp.
References m_func_on_stop, m_looper, m_thread, cubthread::looper::stop(), and wakeup().
Referenced by ~daemon().
void cubthread::daemon::wakeup | ( | void | ) |
Definition at line 71 of file thread_daemon.cpp.
References m_waiter, and cubthread::waiter::wakeup().
Referenced by dwb_write_block(), log_get_checkpoint_interval(), log_wakeup_log_flush_daemon(), pgbuf_bcb_flush_with_wal(), pgbuf_wakeup_page_flush_daemon(), stop_execution(), and vacuum_finished_block_vacuum().
bool cubthread::daemon::was_woken_up | ( | void | ) |
Definition at line 106 of file thread_daemon.cpp.
References m_looper, and cubthread::looper::was_woken_up().
Referenced by pgbuf_get_page_flush_interval().
|
private |
Definition at line 135 of file thread_daemon.hpp.
Referenced by loop_with_context(), and stop_execution().
|
private |
Definition at line 134 of file thread_daemon.hpp.
Referenced by get_stats(), loop_with_context(), loop_without_context(), pause(), reset_looper(), stop_execution(), and was_woken_up().
|
private |
Definition at line 139 of file thread_daemon.hpp.
Referenced by daemon().
|
private |
Definition at line 142 of file thread_daemon.hpp.
Referenced by get_stats(), register_stat_execute(), register_stat_pause(), register_stat_start(), and ~daemon().
|
private |
Definition at line 137 of file thread_daemon.hpp.
Referenced by daemon(), and stop_execution().
|
private |
Definition at line 133 of file thread_daemon.hpp.
Referenced by get_stats(), is_running(), pause(), and wakeup().