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

Public Member Functions | |
| config_builder ()=default | |
| auto | with_worker_count (std::size_t count) -> config_builder & |
| Sets the number of worker threads. | |
| auto | with_queue_capacity (std::size_t capacity) -> config_builder & |
| Sets the queue capacity. | |
| auto | enable_backpressure () -> config_builder & |
| Enables backpressure with default settings. | |
| auto | with_backpressure_policy (backpressure_policy policy) -> config_builder & |
| Sets the backpressure policy. | |
| auto | with_watermarks (double low, double high) -> config_builder & |
| Sets backpressure watermarks. | |
| auto | enable_circuit_breaker () -> config_builder & |
| Enables circuit breaker with default settings. | |
| auto | with_failure_threshold (std::size_t threshold) -> config_builder & |
| Sets circuit breaker failure threshold. | |
| auto | with_open_duration (std::chrono::seconds duration) -> config_builder & |
| Sets circuit breaker open duration. | |
| auto | enable_work_stealing () -> config_builder & |
| Enables work stealing. | |
| auto | with_work_stealing_params (std::size_t max_attempts, std::chrono::microseconds backoff) -> config_builder & |
| Sets work stealing parameters. | |
| auto | enable_priority_aging () -> config_builder & |
| Enables priority aging with default settings. | |
| auto | with_priority_aging_params (std::chrono::milliseconds interval, int boost, int max_boost) -> config_builder & |
| Sets priority aging parameters. | |
| auto | enable_auto_scaling () -> config_builder & |
| Enables auto-scaling. | |
| auto | with_dag_failure_policy (dag_failure_policy policy) -> config_builder & |
| Sets DAG failure policy. | |
| auto | with_dag_retry_params (std::size_t max_retries, std::chrono::milliseconds delay) -> config_builder & |
| Sets DAG retry parameters. | |
| auto | build () -> thread_system_config |
| Builds the final configuration. | |
Private Attributes | |
| thread_system_config | config_ |
Builder for thread_system_config.
Provides a fluent interface for constructing thread_system_config with sensible defaults.
Definition at line 249 of file thread_system_config.h.
|
default |
|
inline |
Builds the final configuration.
Validates the configuration and returns it.
| std::invalid_argument | if configuration is invalid |
Definition at line 437 of file thread_system_config.h.
References config_, and kcenon::thread::thread_system_config::is_valid().

|
inline |
Enables auto-scaling.
Definition at line 398 of file thread_system_config.h.
References kcenon::thread::thread_system_config::scaling_config::auto_scaling_enabled, config_, and kcenon::thread::thread_system_config::scaling.
|
inline |
Enables backpressure with default settings.
Definition at line 280 of file thread_system_config.h.
References kcenon::thread::thread_system_config::pool_config::backpressure, kcenon::thread::block, config_, kcenon::thread::backpressure_config::policy, and kcenon::thread::thread_system_config::pool.
|
inline |
Enables circuit breaker with default settings.
Definition at line 314 of file thread_system_config.h.
References kcenon::thread::thread_system_config::resilience_config::circuit_breaker, config_, and kcenon::thread::thread_system_config::resilience.
|
inline |
Enables priority aging with default settings.
Definition at line 371 of file thread_system_config.h.
References config_, kcenon::thread::priority_aging_config::enabled, kcenon::thread::thread_system_config::scaling_config::priority_aging, and kcenon::thread::thread_system_config::scaling.
|
inline |
Enables work stealing.
Definition at line 347 of file thread_system_config.h.
References config_, kcenon::thread::thread_system_config::pool_config::enable_work_stealing, and kcenon::thread::thread_system_config::pool.
|
inline |
Sets the backpressure policy.
| policy | The backpressure policy to use |
Definition at line 291 of file thread_system_config.h.
References kcenon::thread::thread_system_config::pool_config::backpressure, config_, kcenon::thread::backpressure_config::policy, and kcenon::thread::thread_system_config::pool.
|
inline |
Sets DAG failure policy.
| policy | The failure policy to use |
Definition at line 409 of file thread_system_config.h.
References config_, kcenon::thread::thread_system_config::dag, and kcenon::thread::dag_config::failure_policy.
|
inline |
Sets DAG retry parameters.
| max_retries | Maximum retry attempts |
| delay | Delay between retries |
Definition at line 421 of file thread_system_config.h.
References config_, kcenon::thread::thread_system_config::dag, kcenon::thread::delay, kcenon::thread::dag_config::max_retries, and kcenon::thread::dag_config::retry_delay.
|
inline |
Sets circuit breaker failure threshold.
| threshold | Number of consecutive failures to open circuit |
Definition at line 325 of file thread_system_config.h.
References kcenon::thread::thread_system_config::resilience_config::circuit_breaker, config_, and kcenon::thread::thread_system_config::resilience.
|
inline |
Sets circuit breaker open duration.
| duration | Time in open state before half-open |
Definition at line 336 of file thread_system_config.h.
References kcenon::thread::thread_system_config::resilience_config::circuit_breaker, config_, and kcenon::thread::thread_system_config::resilience.
|
inline |
Sets priority aging parameters.
| interval | Aging interval |
| boost | Boost per interval |
| max_boost | Maximum boost |
Definition at line 384 of file thread_system_config.h.
References kcenon::thread::priority_aging_config::aging_interval, config_, kcenon::thread::priority_aging_config::max_priority_boost, kcenon::thread::thread_system_config::scaling_config::priority_aging, kcenon::thread::priority_aging_config::priority_boost_per_interval, and kcenon::thread::thread_system_config::scaling.
|
inline |
Sets the queue capacity.
| capacity | Maximum queue size |
Definition at line 270 of file thread_system_config.h.
References config_, kcenon::thread::thread_system_config::pool, and kcenon::thread::thread_system_config::pool_config::queue_capacity.
|
inline |
Sets backpressure watermarks.
| low | Low watermark (0.0 to 1.0) |
| high | High watermark (0.0 to 1.0) |
Definition at line 303 of file thread_system_config.h.
References kcenon::thread::thread_system_config::pool_config::backpressure, config_, kcenon::thread::high, kcenon::thread::backpressure_config::high_watermark, kcenon::thread::low, kcenon::thread::backpressure_config::low_watermark, and kcenon::thread::thread_system_config::pool.
|
inline |
Sets work stealing parameters.
| max_attempts | Maximum steal attempts |
| backoff | Backoff duration between attempts |
Definition at line 359 of file thread_system_config.h.
References config_, kcenon::thread::thread_system_config::pool_config::max_steal_attempts, kcenon::thread::thread_system_config::pool, and kcenon::thread::thread_system_config::pool_config::steal_backoff.
|
inline |
Sets the number of worker threads.
| count | Number of workers |
Definition at line 259 of file thread_system_config.h.
References config_, kcenon::thread::thread_system_config::pool, and kcenon::thread::thread_system_config::pool_config::worker_count.
|
private |
Definition at line 447 of file thread_system_config.h.
Referenced by build(), enable_auto_scaling(), enable_backpressure(), enable_circuit_breaker(), enable_priority_aging(), enable_work_stealing(), with_backpressure_policy(), with_dag_failure_policy(), with_dag_retry_params(), with_failure_threshold(), with_open_duration(), with_priority_aging_params(), with_queue_capacity(), with_watermarks(), with_work_stealing_params(), and with_worker_count().