MySQL 8.0.40
Source Code Documentation
|
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_t & | m_log |
os_event_t | m_event |
const uint32_t | m_spin_delay |
const std::chrono::microseconds | m_min_timeout |
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.
|
inline |
|
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.
|
private |
|
private |
|
private |
|
private |