|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Priority with aging support. More...
#include <priority_aging_config.h>


Public Member Functions | |
| auto | effective_priority () const -> P |
| Calculates the effective priority including boost. | |
| auto | wait_time () const -> std::chrono::milliseconds |
| Calculates the time this job has been waiting. | |
| auto | apply_boost (int boost_amount, int max_boost) -> void |
| Applies a boost to the priority. | |
| auto | reset_boost () -> void |
| Resets the boost to zero. | |
| auto | is_max_boosted (int max_boost) const -> bool |
| Checks if this job has reached max boost. | |
Public Attributes | |
| P | base_priority |
| The original priority level of the job. | |
| int | boost {0} |
| The current priority boost value. | |
| std::chrono::steady_clock::time_point | enqueue_time |
| The time when the job was enqueued. | |
Priority with aging support.
This structure wraps a base priority value with aging information, including the current boost level and enqueue time. It provides methods to calculate the effective priority and wait time.
| P | The base priority type (typically an enum or integral type). |
Definition at line 174 of file priority_aging_config.h.
|
inline |
Applies a boost to the priority.
| boost_amount | The amount to boost. |
| max_boost | The maximum allowed boost. |
Definition at line 233 of file priority_aging_config.h.
References kcenon::thread::aged_priority< P >::boost.
|
inlinenodiscard |
Calculates the effective priority including boost.
For enum types, the boost is subtracted from the enum value (lower enum value = higher priority). For integral types, the boost is added.
Definition at line 204 of file priority_aging_config.h.
References kcenon::thread::aged_priority< P >::base_priority, and kcenon::thread::aged_priority< P >::boost.
|
inlinenodiscard |
Checks if this job has reached max boost.
| max_boost | The maximum allowed boost. |
Definition at line 256 of file priority_aging_config.h.
References kcenon::thread::aged_priority< P >::boost.
Referenced by kcenon::thread::aging_typed_job_t< job_type >::is_max_boosted().

|
inline |
Resets the boost to zero.
Definition at line 245 of file priority_aging_config.h.
References kcenon::thread::aged_priority< P >::boost.
|
inlinenodiscard |
Calculates the time this job has been waiting.
Definition at line 220 of file priority_aging_config.h.
References kcenon::thread::aged_priority< P >::enqueue_time.
| P kcenon::thread::aged_priority< P >::base_priority |
The original priority level of the job.
Definition at line 179 of file priority_aging_config.h.
Referenced by kcenon::thread::aged_priority< P >::effective_priority().
| int kcenon::thread::aged_priority< P >::boost {0} |
The current priority boost value.
This value is added to the base priority to get the effective priority.
Definition at line 186 of file priority_aging_config.h.
Referenced by kcenon::thread::aged_priority< P >::apply_boost(), kcenon::thread::aged_priority< P >::effective_priority(), kcenon::thread::aged_priority< P >::is_max_boosted(), and kcenon::thread::aged_priority< P >::reset_boost().
| std::chrono::steady_clock::time_point kcenon::thread::aged_priority< P >::enqueue_time |
The time when the job was enqueued.
Used to calculate wait time for aging purposes.
Definition at line 193 of file priority_aging_config.h.
Referenced by kcenon::thread::aged_priority< P >::wait_time().