ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
adaptive_sleep_config_t Struct Reference

Configuration for adaptive sleep behavior. More...

#include <include/ascii-chat/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 677 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 678 of file time.h.

Referenced by adaptive_sleep_calculate(), adaptive_sleep_init(), session_capture_create(), and session_network_capture_create().

◆ 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 680 of file time.h.

Referenced by adaptive_sleep_calculate(), and adaptive_sleep_init().

◆ min_speed_multiplier

double adaptive_sleep_config_t::min_speed_multiplier

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

Definition at line 679 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 682 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 681 of file time.h.

Referenced by adaptive_sleep_calculate().


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