CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
Task Queue Configuration

Functions

void tqPresetSingle (TaskQueueConfig *tqconfig)
 
void tqPresetMinimal (TaskQueueConfig *tqconfig)
 
void tqPresetBalanced (TaskQueueConfig *tqconfig)
 
void tqPresetHeavy (TaskQueueConfig *tqconfig)
 
void tqPresetManual (TaskQueueConfig *tqconfig)
 
void tqEnableMonitor (TaskQueueConfig *tqconfig)
 

Detailed Description

Function Documentation

◆ tqEnableMonitor()

void tqEnableMonitor ( TaskQueueConfig tqconfig)

void tqEnableMonitor(TaskQueueConfig *tqconfig)

Update an existing config to enable sensible defaults for queue monitoring. Enables detection of stuck tasks, long-running tasks, and tasks waiting too long.

Parameters
tqconfigConfiguration structure to update

◆ tqPresetBalanced()

void tqPresetBalanced ( TaskQueueConfig tqconfig)

void tqPresetBalanced(TaskQueueConfig *tqconfig)

Initialize a queue config with balanced presets based on logical cores. General-purpose configuration suitable for most applications. 2 idle workers, grows to physical CPU count when busy, max = logical CPU count.

Parameters
tqconfigConfiguration structure to initialize

◆ tqPresetHeavy()

void tqPresetHeavy ( TaskQueueConfig tqconfig)

void tqPresetHeavy(TaskQueueConfig *tqconfig)

Initialize a queue config for high performance under sustained heavy load. Uses a dedicated manager thread, 4 idle workers, and can scale to 150% of logical CPUs.

Parameters
tqconfigConfiguration structure to initialize

◆ tqPresetManual()

void tqPresetManual ( TaskQueueConfig tqconfig)

void tqPresetManual(TaskQueueConfig *tqconfig)

Initialize a queue config for manual ticking without a thread pool. Queue must be ticked manually with tqTick(). Suitable for integration with existing event loops.

Parameters
tqconfigConfiguration structure to initialize

◆ tqPresetMinimal()

void tqPresetMinimal ( TaskQueueConfig tqconfig)

void tqPresetMinimal(TaskQueueConfig *tqconfig)

Initialize a queue config with minimal presets based on the number of physical cores. Starts with 1 worker, grows to half the physical CPU count when busy. Maximum workers equals the physical CPU count.

Parameters
tqconfigConfiguration structure to initialize

◆ tqPresetSingle()

void tqPresetSingle ( TaskQueueConfig tqconfig)

void tqPresetSingle(TaskQueueConfig *tqconfig)

Initialize a queue config for a queue with a single worker thread. Suitable for UI threads or other scenarios requiring serial execution.

Parameters
tqconfigConfiguration structure to initialize