58 std::size_t
max_threads = std::thread::hardware_concurrency();
129 [[nodiscard]]
virtual auto start() ->
bool = 0;
136 [[nodiscard]]
virtual auto is_running() const noexcept ->
bool = 0;
145 virtual
void shutdown(
bool wait_for_completion = true) = 0;
162 [[nodiscard]] virtual auto
submit(std::function<
void()> task)
163 -> std::future<
void> = 0;
178 std::function<
void()> task) -> std::future<
void> = 0;
virtual auto get_idle_worker_count() const -> std::size_t=0
Get the number of idle workers.
virtual void shutdown(bool wait_for_completion=true)=0
Shutdown the thread pool.
virtual void submit_fire_and_forget(std::function< void()> task)=0
Submit a task without waiting for completion.
virtual auto start() -> bool=0
Start the thread pool.
virtual auto get_thread_count() const -> std::size_t=0
Get the current number of worker threads.
virtual auto get_pending_task_count() const -> std::size_t=0
Get the number of pending tasks in the queue.
virtual auto submit_with_priority(job_priority priority, std::function< void()> task) -> std::future< void >=0
Submit a task with a specific priority level.
virtual auto is_running() const noexcept -> bool=0
Check if the thread pool is running.
virtual auto submit(std::function< void()> task) -> std::future< void >=0
Submit a task for execution.
virtual ~thread_pool_interface()=default
Virtual destructor for proper polymorphic destruction.
job_priority
Priority levels for job scheduling.
@ low
Background tasks (cleanup, maintenance)
@ critical
C-ECHO, association handling - highest priority.
Configuration options for the thread pool.
std::string pool_name
Thread pool name for logging.
bool use_lock_free_queue
Enable lock-free queue for higher throughput.
std::chrono::milliseconds idle_timeout
Time before idle threads are terminated (for dynamic scaling)
std::size_t min_threads
Minimum number of worker threads.
std::size_t max_threads
Maximum number of worker threads.