MySQL 8.0.39
Source Code Documentation
Log_thread_waiting Struct Reference

Small utility which is used inside log threads when they have to wait for next interesting event to happen. More...

Public Member Functions

 Log_thread_waiting (const log_t &log, os_event_t event, uint64_t spin_delay, std::chrono::microseconds min_timeout)
 
template<typename Stop_condition >
Wait_stats wait (Stop_condition stop_condition)
 

Private Attributes

const log_tm_log
 
os_event_t m_event
 
const uint32_t m_spin_delay
 
const std::chrono::microseconds m_min_timeout
 

Detailed Description

Small utility which is used inside log threads when they have to wait for next interesting event to happen.

For performance reasons, it might make sense to use spin-delay in front of the wait on event in such cases. The strategy is first to spin and then to fallback to the wait on event. However, for idle servers or work-loads which do not need redo being flushed as often, we prefer to avoid spinning. This utility solves such problems and provides waiting mechanism.

Constructor & Destructor Documentation

◆ Log_thread_waiting()

Log_thread_waiting::Log_thread_waiting ( const log_t log,
os_event_t  event,
uint64_t  spin_delay,
std::chrono::microseconds  min_timeout 
)
inline

Member Function Documentation

◆ wait()

template<typename Stop_condition >
Wait_stats Log_thread_waiting::wait ( Stop_condition  stop_condition)
inline

We might read older value, it just decides on spinning. Correctness does not depend on this. Only local performance might depend on this but it's anyway heuristic and depends on average which by definition has lag. No reason to make extra barriers here.

Member Data Documentation

◆ m_event

os_event_t Log_thread_waiting::m_event
private

◆ m_log

const log_t& Log_thread_waiting::m_log
private

◆ m_min_timeout

const std::chrono::microseconds Log_thread_waiting::m_min_timeout
private

◆ m_spin_delay

const uint32_t Log_thread_waiting::m_spin_delay
private

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