209 auto boosted_value = base_value -
boost;
211 boosted_value = (boosted_value < 0) ? 0 : boosted_value;
212 return static_cast<P
>(boosted_value);
222 return std::chrono::duration_cast<std::chrono::milliseconds>(
235 boost += boost_amount;
236 if (
boost > max_boost)
258 return boost >= max_boost;
Core threading foundation of the thread system library.
@ linear
Linearly increasing delay.
aging_curve
Defines different aging curve algorithms.
@ logarithmic
Decreasing boost (fast initial, slow later)
@ linear
Constant boost per interval.
@ exponential
Increasing boost over time.
Priority with aging support.
auto is_max_boosted(int max_boost) const -> bool
Checks if this job has reached max boost.
auto apply_boost(int boost_amount, int max_boost) -> void
Applies a boost to the priority.
auto effective_priority() const -> P
Calculates the effective priority including boost.
auto reset_boost() -> void
Resets the boost to zero.
std::chrono::steady_clock::time_point enqueue_time
The time when the job was enqueued.
int boost
The current priority boost value.
P base_priority
The original priority level of the job.
auto wait_time() const -> std::chrono::milliseconds
Calculates the time this job has been waiting.
Information about a job for starvation callback.
std::chrono::milliseconds wait_time
Configuration for priority aging behavior.
double exponential_factor
Exponential factor for exponential aging curve.
aging_curve curve
The aging curve algorithm to use.
bool enabled
Whether priority aging is enabled.
std::function< void(const job_info &)> starvation_callback
Callback function invoked when a job is starving.
int priority_boost_per_interval
Amount of priority boost applied per aging interval.
int max_priority_boost
Maximum total priority boost that can be applied.
std::chrono::milliseconds aging_interval
Interval at which aging is applied.
std::chrono::seconds starvation_threshold
Threshold for starvation detection.
bool reset_on_dequeue
Whether to reset the boost when a job is dequeued.