C++ Concurrency Sandbox
Loading...
Searching...
No Matches
AgedTask Struct Reference

Represents a task whose priority can increase over time. More...

Collaboration diagram for AgedTask:

Public Member Functions

bool operator< (const AgedTask &other) const
 Heap comparator. Higher current_priority values are moved to the front of the heap.
 

Public Attributes

int original_priority
 The priority assigned at submission.
 
int current_priority
 The boosted priority after aging.
 
system_clock::time_point arrival_time
 Timestamp of when the task entered the pool.
 
std::function< void()> func
 The callable task logic.
 
std::string task_name
 Human-readable name for logging.
 

Detailed Description

Represents a task whose priority can increase over time.

  • Contains metadata regarding original priority, current (aged) priority, and arrival time to facilitate the aging calculation.

Definition at line 27 of file AgingPriority.cpp.

Member Function Documentation

◆ operator<()

bool AgedTask::operator< ( const AgedTask other) const
inline

Heap comparator. Higher current_priority values are moved to the front of the heap.

Definition at line 38 of file AgingPriority.cpp.

38 {
40 }
int current_priority
The boosted priority after aging.

References current_priority.

Member Data Documentation

◆ arrival_time

system_clock::time_point AgedTask::arrival_time

Timestamp of when the task entered the pool.

Definition at line 30 of file AgingPriority.cpp.

Referenced by AgingPriorityPool::enqueue().

◆ current_priority

int AgedTask::current_priority

The boosted priority after aging.

Definition at line 29 of file AgingPriority.cpp.

Referenced by AgingPriorityPool::enqueue(), and operator<().

◆ func

std::function<void()> AgedTask::func

The callable task logic.

Definition at line 31 of file AgingPriority.cpp.

Referenced by AgingPriorityPool::enqueue().

◆ original_priority

int AgedTask::original_priority

The priority assigned at submission.

Definition at line 28 of file AgingPriority.cpp.

Referenced by AgingPriorityPool::enqueue().

◆ task_name

std::string AgedTask::task_name

Human-readable name for logging.

Definition at line 32 of file AgingPriority.cpp.

Referenced by AgingPriorityPool::enqueue().


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