42namespace ts = threadschedule;
103#if defined(__cpp_impl_coroutine) && __cpp_impl_coroutine >= 201902L
104using ts::executor_base;
106using ts::pool_executor;
108using ts::schedule_on;
Test/chaos features to perturb scheduling at runtime.
RAII controller that periodically perturbs scheduling attributes of registered threads for chaos/fuzz...
Central registry and dispatcher for task-error callbacks.
A move-only future wrapper that supports an error callback.
Singleton accessor for a process-wide pool instance.
Ultra-lightweight fire-and-forget thread pool.
RAII wrapper around POSIX threads with a modern C++ interface.
Thread pool wrapper that combines any pool type with an ErrorHandler.
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.
Single-queue thread pool parameterized by its idle-wait strategy.
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.
Error handling primitives: TaskError, ErrorHandler, and ErrorHandledTask.
Combinators for std::future: when_all, when_any, when_all_settled.
Lazy multi-value coroutine (generator<T>).
SchedulingPolicy
Enumeration of available thread scheduling policies.
PoolWithErrors< FastThreadPool > FastThreadPoolWithErrors
FastThreadPool with integrated error handling.
ShutdownPolicy
Controls how a pool handles pending tasks during shutdown.
ThreadPoolBase< IndefiniteWait > ThreadPool
General-purpose thread pool with indefinite blocking wait.
auto apply_profile(ThreadLike &t, ThreadProfile const &p) -> expected< void, std::error_code >
Apply a profile to a thread wrapper or view.
BuildMode
Indicates whether the library was compiled in header-only or runtime (shared library) mode.
auto affinity_for_node(int node_index, int thread_index, int threads_per_node=1) -> ThreadAffinity
Build a ThreadAffinity for the given NUMA node.
auto distribute_affinities_by_numa(size_t num_threads) -> std::vector< ThreadAffinity >
Distribute thread affinities across NUMA nodes in round-robin order.
GlobalPool< ThreadPool > GlobalThreadPool
Singleton accessor for the process-wide ThreadPool instance.
ThreadWrapperView JThreadWrapperView
ScheduledThreadPoolT< ThreadPool > ScheduledThreadPool
ScheduledThreadPoolT using the default ThreadPool backend.
ThreadPoolBase< PollingWait<> > FastThreadPool
Thread pool with 10 ms polling wait for lower wake-up latency.
PoolWithErrors< ThreadPool > ThreadPoolWithErrors
ThreadPool with integrated error handling.
GlobalPool< HighPerformancePool > GlobalHighPerformancePool
Singleton accessor for the process-wide HighPerformancePool instance.
ScheduledThreadPoolT< FastThreadPool > ScheduledFastThreadPool
ScheduledThreadPoolT using FastThreadPool as backend.
PoolWithErrors< HighPerformancePool > HighPerformancePoolWithErrors
HighPerformancePool with integrated error handling.
ScheduledThreadPoolT< LightweightPool > ScheduledLightweightPool
ScheduledThreadPoolT using LightweightPool as backend (minimal overhead).
std::function< void(std::chrono::steady_clock::time_point, std::thread::id, std::chrono::microseconds elapsed)> TaskEndCallback
Callback invoked when a pool worker finishes executing a task.
auto build_mode_string() -> char const *
Returns a human-readable C string describing the active build mode.
auto when_all(std::vector< std::future< T > > &futures) -> std::vector< T >
Block until all futures complete, returning results in submission order.
std::function< void(TaskError const &)> ErrorCallback
Signature for error-handling callbacks registered with ErrorHandler.
std::function< void(std::chrono::steady_clock::time_point, std::thread::id)> TaskStartCallback
Work-stealing deque for per-thread task queues in a thread pool.
ScheduledThreadPoolT< HighPerformancePool > ScheduledHighPerformancePool
ScheduledThreadPoolT using HighPerformancePool as backend.
auto when_all_settled(std::vector< std::future< T > > &futures) -> std::vector< expected< T, std::exception_ptr > >
Block until all futures complete, returning an expected per slot.
auto when_any(std::vector< std::future< T > > &futures) -> std::pair< size_t, T >
Block until the first future becomes ready.
ThreadWrapper JThreadWrapper
Owning wrapper around std::jthread with cooperative cancellation (C++20).
auto read_topology() -> CpuTopology
Discover basic topology. Linux: reads /sys for NUMA nodes. Windows: single node, sequential CPU indic...
auto build_mode() -> BuildMode
Returns the build mode detected at compile time (header-only variant).
LightweightPoolT<> LightweightPool
Default lightweight pool with 64-byte task slots (56 bytes usable).
High-level thread configuration profiles and helpers.
RAII wrapper around POSIX threads (Linux only).
Delayed and periodic task scheduling on top of any pool type.
Scheduling policies, thread priority, and CPU affinity types.
Plain value type holding runtime chaos-testing parameters.
Snapshot of basic CPU/NUMA topology.
Wait policy that polls with a configurable timeout.
Holds diagnostic information captured from a failed task.
Declarative profile bundling scheduling intent for a thread.
Coroutine task, sync_wait, and pool helpers schedule_on / run_on.
Thread pools: HighPerformancePool, ThreadPoolBase, LightweightPoolT, and GlobalPool.
PoolWithErrors wrapper that combines any pool with an ErrorHandler.
Process-wide thread registry, control blocks, and composite registry.
Enhanced thread wrappers: ThreadWrapper, JThreadWrapper, and non-owning views.
Hardware topology helpers (CPU count, NUMA nodes) and affinity builders.