ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
adaptive_sleep_config_t Struct Reference

Configuration for adaptive sleep behavior. More...

#include <lib/util/time.h>

Data Fields

uint64_t baseline_sleep_ns
 Normal sleep time in nanoseconds (when queue is at target)
 
double min_speed_multiplier
 Minimum speed (max sleep) - usually 1.0 (baseline speed)
 
double max_speed_multiplier
 Maximum speed (min sleep) - e.g., 4.0 = process 4x faster.
 
double speedup_rate
 Ramp-up rate when queue builds (0.0-1.0, higher = faster ramp)
 
double slowdown_rate
 Ramp-down rate when queue empties (0.0-1.0, higher = faster ramp)
 

Detailed Description

Configuration for adaptive sleep behavior.

Defines how a thread should adjust its sleep time based on workload. Threads can speed up (sleep less) when queues build up and slow down (sleep more) when queues are empty.

Definition at line 294 of file time.h.

Field Documentation

◆ baseline_sleep_ns

uint64_t adaptive_sleep_config_t::baseline_sleep_ns

Normal sleep time in nanoseconds (when queue is at target)

Definition at line 295 of file time.h.

Referenced by adaptive_sleep_calculate(), and adaptive_sleep_init().

◆ max_speed_multiplier

double adaptive_sleep_config_t::max_speed_multiplier

Maximum speed (min sleep) - e.g., 4.0 = process 4x faster.

Definition at line 297 of file time.h.

Referenced by adaptive_sleep_calculate().

◆ min_speed_multiplier

double adaptive_sleep_config_t::min_speed_multiplier

Minimum speed (max sleep) - usually 1.0 (baseline speed)

Definition at line 296 of file time.h.

Referenced by adaptive_sleep_calculate(), and adaptive_sleep_init().

◆ slowdown_rate

double adaptive_sleep_config_t::slowdown_rate

Ramp-down rate when queue empties (0.0-1.0, higher = faster ramp)

Definition at line 299 of file time.h.

Referenced by adaptive_sleep_calculate().

◆ speedup_rate

double adaptive_sleep_config_t::speedup_rate

Ramp-up rate when queue builds (0.0-1.0, higher = faster ramp)

Definition at line 298 of file time.h.

Referenced by adaptive_sleep_calculate().


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