ThreadSchedule 2.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::PollingWait< IntervalMs > Struct Template Reference

Wait policy that polls with a configurable timeout. More...

#include <thread_pool.hpp>

Static Public Member Functions

template<typename Lock, typename Pred>
static auto wait (std::condition_variable &cv, Lock &lock, Pred pred) -> bool

Detailed Description

template<unsigned IntervalMs = 10>
struct threadschedule::PollingWait< IntervalMs >

Wait policy that polls with a configurable timeout.

Workers periodically re-check the queue even without notification, trading a small amount of CPU for lower wake-up latency under bursty workloads. Used by the FastThreadPool type alias (default 10 ms).

Template Parameters
IntervalMsPolling interval in milliseconds.

Definition at line 1200 of file thread_pool.hpp.

Member Function Documentation

◆ wait()

template<unsigned IntervalMs = 10>
template<typename Lock, typename Pred>
auto threadschedule::PollingWait< IntervalMs >::wait ( std::condition_variable & cv,
Lock & lock,
Pred pred ) -> bool
inlinestatic

Definition at line 1203 of file thread_pool.hpp.


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