153 [[nodiscard]]
auto steal_for(std::size_t worker_id) ->
job*;
168 [[nodiscard]]
auto steal_batch_for(std::size_t worker_id, std::size_t max_count)
169 -> std::vector<job*>;
217 ->
std::vector<
std::
size_t>;
223 ->
std::vector<
std::
size_t>;
229 ->
std::vector<
std::
size_t>;
235 ->
std::vector<
std::
size_t>;
241 ->
std::vector<
std::
size_t>;
247 ->
std::vector<
std::
size_t>;
253 ->
std::vector<
std::
size_t>;
Calculates backoff delays for work-stealing operations.
Represents a unit of work (task) to be executed, typically by a job queue.
Lock-free work-stealing deque based on Chase-Lev algorithm.
NUMA (Non-Uniform Memory Access) topology information.
NUMA-aware work stealer with enhanced victim selection policies.
auto select_victims_adaptive(std::size_t requester_id, std::size_t count) -> std::vector< std::size_t >
Select victims using adaptive (queue-size based) policy.
numa_work_stealer(numa_work_stealer &&)=delete
auto select_victims_round_robin(std::size_t requester_id, std::size_t count) -> std::vector< std::size_t >
Select victims using round-robin policy.
auto get_config() const -> const enhanced_work_stealing_config &
Get the current configuration.
auto select_victims_locality_aware(std::size_t requester_id, std::size_t count) -> std::vector< std::size_t >
Select victims using locality-aware policy.
std::atomic< std::size_t > round_robin_index_
std::size_t worker_count_
auto get_stats() const -> const work_stealing_stats &
Get the current statistics.
auto get_stats_snapshot() const -> work_stealing_stats_snapshot
Get a snapshot of current statistics.
void set_config(const enhanced_work_stealing_config &config)
Update the configuration.
void record_steal(std::size_t thief_id, std::size_t victim_id)
Record a successful steal for affinity tracking.
numa_work_stealer(std::size_t worker_count, deque_accessor_fn deque_accessor, cpu_accessor_fn cpu_accessor, enhanced_work_stealing_config config={})
Construct a NUMA-aware work stealer.
auto workers_on_same_node(std::size_t worker_a, std::size_t worker_b) const -> bool
Check if two workers are on the same NUMA node.
numa_work_stealer & operator=(const numa_work_stealer &)=delete
work_stealing_stats stats_
auto get_worker_cpu(std::size_t worker_id) const -> int
Get the CPU ID for a worker.
auto get_topology() const -> const numa_topology &
Get the NUMA topology information.
cpu_accessor_fn cpu_accessor_
numa_work_stealer(const numa_work_stealer &)=delete
std::function< int(std::size_t)> cpu_accessor_fn
Function type for getting worker's CPU affinity.
~numa_work_stealer()=default
Destructor.
auto select_victims_random(std::size_t requester_id, std::size_t count) -> std::vector< std::size_t >
Select victims using random policy.
enhanced_work_stealing_config config_
deque_accessor_fn deque_accessor_
numa_work_stealer & operator=(numa_work_stealer &&)=delete
auto select_victims_hierarchical(std::size_t requester_id, std::size_t count) -> std::vector< std::size_t >
Select victims using hierarchical policy.
auto select_victims_numa_aware(std::size_t requester_id, std::size_t count) -> std::vector< std::size_t >
Select victims using NUMA-aware policy.
std::function< lockfree::work_stealing_deque< job * > *(std::size_t)> deque_accessor_fn
Function type for accessing worker's local deque.
auto steal_for(std::size_t worker_id) -> job *
Attempt to steal work for a worker.
auto steal_batch_for(std::size_t worker_id, std::size_t max_count) -> std::vector< job * >
Attempt to steal multiple jobs for a worker.
std::unique_ptr< work_affinity_tracker > affinity_tracker_
void reset_stats()
Reset all statistics to zero.
auto calculate_batch_size(std::size_t victim_queue_size) const -> std::size_t
Calculate batch size based on configuration and victim queue depth.
auto select_victims(std::size_t requester_id, std::size_t count) -> std::vector< std::size_t >
Select victim workers based on the configured policy.
std::unique_ptr< backoff_calculator > backoff_calculator_
Tracks cooperation patterns between workers for locality-aware stealing.
Configuration for enhanced work-stealing with NUMA awareness.
Core threading foundation of the thread system library.
NUMA node topology detection and information.
Backoff strategies for work-stealing operations.
Configuration for enhanced work-stealing with NUMA awareness.
Non-atomic snapshot of work-stealing statistics.
Statistics for work-stealing operations.
Tracks cooperation patterns between workers for locality-aware stealing.
Statistics snapshot for work-stealing performance monitoring.