ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "chaos.hpp"
4#include "concepts.hpp"
5#include "error_handler.hpp"
6#include "generator.hpp"
7#include "profiles.hpp"
8#include "pthread_wrapper.hpp"
9#include "scheduled_pool.hpp"
10#include "scheduler_policy.hpp"
11#include "task.hpp"
12#include "thread_pool.hpp"
13#include "thread_pool_with_errors.hpp"
14#include "thread_registry.hpp"
15#include "thread_wrapper.hpp"
16#include "topology.hpp"
17
34
35namespace threadschedule
36{
37
41namespace ts = threadschedule;
42
43// Re-export main types for convenience
44#ifndef _WIN32
46#endif
49using ts::ChaosConfig;
51using ts::CpuTopology;
53using ts::ErrorCallback;
60using ts::JThreadWrapper;
61using ts::JThreadWrapperView;
63using ts::ScheduledFastThreadPool;
64using ts::ScheduledHighPerformancePool;
66using ts::ScheduledThreadPool;
68using ts::SchedulingPolicy;
69using ts::TaskError;
72using ts::ThreadPool;
78
79// Build-mode introspection
80using ts::BuildMode;
81using ts::build_mode;
82using ts::build_mode_string;
83
84// Coroutine primitives (C++20)
85#if defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L
86using ts::task;
87using ts::sync_wait;
88using ts::generator;
89#endif
90
91} // namespace threadschedule
Test/chaos features to perturb scheduling at runtime.
RAII controller that periodically perturbs scheduling attributes of registered threads for chaos/fuzz...
Definition chaos.hpp:86
Central registry and dispatcher for task-error callbacks.
FastThreadPool combined with an ErrorHandler.
Single-queue thread pool with optimized locking for medium workloads.
A move-only future wrapper that supports an error callback.
HighPerformancePool combined with an ErrorHandler.
High-performance thread pool optimized for high-frequency task submission.
RAII wrapper around POSIX threads with a modern C++ interface.
Copyable handle for a cancellable scheduled task.
Thread pool augmented with delayed and periodic task scheduling.
Manages a set of CPU indices to which a thread may be bound.
Looks up an OS thread by its name via /proc and provides scheduling control.
ThreadPool combined with an ErrorHandler.
Simple, general-purpose thread pool.
Value-semantic wrapper for a thread scheduling priority.
Non-owning view over an externally managed std::thread.
Owning wrapper around std::thread with RAII join-on-destroy semantics.
C++20 concepts, type traits, and SFINAE helpers for the threading library.
Lazy multi-value coroutine (generator<T>).
High-level thread configuration profiles and helpers.
auto apply_profile(ThreadLike &t, ThreadProfile const &p) -> expected< void, std::error_code >
Apply a profile to a thread wrapper or view.
Definition profiles.hpp:119
Plain value type holding runtime chaos-testing parameters.
Definition chaos.hpp:34
Snapshot of basic CPU/NUMA topology.
Definition topology.hpp:39
Holds diagnostic information captured from a failed task.
Declarative profile bundling scheduling intent for a thread.
Definition profiles.hpp:57
Lazy single-value coroutine (task<T>) and blocking bridge (sync_wait).
Hardware topology helpers (CPU count, NUMA nodes) and affinity builders.
auto affinity_for_node(int node_index, int thread_index, int threads_per_node=1) -> ThreadAffinity
Build a ThreadAffinity for the given NUMA node.
Definition topology.hpp:151
auto distribute_affinities_by_numa(size_t num_threads) -> std::vector< ThreadAffinity >
Distribute thread affinities across NUMA nodes in round-robin order.
Definition topology.hpp:182
auto read_topology() -> CpuTopology
Discover basic topology. Linux: reads /sys for NUMA nodes. Windows: single node, sequential CPU indic...
Definition topology.hpp:53