|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Configuration for thread pool behavior. More...
#include <thread_system_config.h>

Public Attributes | |
| std::size_t | worker_count = std::thread::hardware_concurrency() |
| Number of worker threads in the pool. | |
| std::size_t | queue_capacity = 10000 |
| Maximum number of jobs in the queue. | |
| backpressure_config | backpressure {} |
| Backpressure configuration. | |
| std::chrono::milliseconds | wake_interval {100} |
| Wake interval for idle workers. | |
| std::chrono::seconds | shutdown_timeout {5} |
| Shutdown timeout. | |
| std::chrono::seconds | worker_idle_timeout {30} |
| Worker idle timeout. | |
| bool | yield_on_idle = true |
| Yield on idle. | |
| bool | enable_work_stealing = false |
| Enable work stealing. | |
| std::size_t | max_steal_attempts = 3 |
| Maximum steal attempts before backing off. | |
| std::chrono::microseconds | steal_backoff {50} |
| Backoff duration between steal attempts. | |
Configuration for thread pool behavior.
Definition at line 62 of file thread_system_config.h.
| backpressure_config kcenon::thread::thread_system_config::pool_config::backpressure {} |
Backpressure configuration.
Controls how the queue handles overflow conditions. Default: blocking policy with 5s timeout
Definition at line 85 of file thread_system_config.h.
Referenced by kcenon::thread::config_builder::enable_backpressure(), kcenon::thread::thread_system_config::is_valid(), kcenon::thread::config_builder::with_backpressure_policy(), and kcenon::thread::config_builder::with_watermarks().
| bool kcenon::thread::thread_system_config::pool_config::enable_work_stealing = false |
Enable work stealing.
When true, idle workers can steal jobs from busy workers. Default: false (can be enabled via THREAD_WORK_STEALING_ENABLED)
Definition at line 125 of file thread_system_config.h.
Referenced by kcenon::thread::config_builder::enable_work_stealing().
| std::size_t kcenon::thread::thread_system_config::pool_config::max_steal_attempts = 3 |
Maximum steal attempts before backing off.
Only used when work stealing is enabled. Default: 3
Definition at line 133 of file thread_system_config.h.
Referenced by kcenon::thread::config_builder::with_work_stealing_params().
| std::size_t kcenon::thread::thread_system_config::pool_config::queue_capacity = 10000 |
Maximum number of jobs in the queue.
Default: 10000 jobs Set to 0 for unlimited (not recommended for production)
Definition at line 77 of file thread_system_config.h.
Referenced by kcenon::thread::config_builder::with_queue_capacity().
| std::chrono::seconds kcenon::thread::thread_system_config::pool_config::shutdown_timeout {5} |
Shutdown timeout.
Maximum time to wait for workers to complete during shutdown. Default: 5s
Definition at line 101 of file thread_system_config.h.
| std::chrono::microseconds kcenon::thread::thread_system_config::pool_config::steal_backoff {50} |
Backoff duration between steal attempts.
Only used when work stealing is enabled. Default: 50μs
Definition at line 141 of file thread_system_config.h.
Referenced by kcenon::thread::config_builder::with_work_stealing_params().
| std::chrono::milliseconds kcenon::thread::thread_system_config::pool_config::wake_interval {100} |
Wake interval for idle workers.
How often idle workers check for new jobs. Default: 100ms
Definition at line 93 of file thread_system_config.h.
| std::size_t kcenon::thread::thread_system_config::pool_config::worker_count = std::thread::hardware_concurrency() |
Number of worker threads in the pool.
Default: hardware_concurrency() (number of CPU cores)
Definition at line 69 of file thread_system_config.h.
Referenced by kcenon::thread::thread_system_config::is_valid(), and kcenon::thread::config_builder::with_worker_count().
| std::chrono::seconds kcenon::thread::thread_system_config::pool_config::worker_idle_timeout {30} |
Worker idle timeout.
Workers will be stopped after being idle for this duration. Default: 30s
Definition at line 109 of file thread_system_config.h.
| bool kcenon::thread::thread_system_config::pool_config::yield_on_idle = true |
Yield on idle.
When true, idle workers yield CPU to other threads. Default: true
Definition at line 117 of file thread_system_config.h.