ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule Namespace Reference

Namespaces

namespace  advanced
 
namespace  detail
 Aggregates multiple thread_registry_backend instances into a single queryable view.
 
namespace  schedule
 Helpers for building scheduling_config values.
 
namespace  this_thread
 Portable configuration operations for the calling thread.
 

Classes

class  auto_register_current_thread
 RAII registration of the calling thread in a portable registry. More...
 
class  bad_expected_access
 
class  cpu_id
 Validated CPU identifier. More...
 
class  expected
 
class  expected< void, E >
 
class  global_registry_binding
 Temporarily bind an owning registry as the global external registry. More...
 
class  nice_value
 Strongly-typed nice value in the POSIX range $[-20, 19]$. More...
 
struct  pool_statistics
 Snapshot of pool activity metrics. More...
 
class  realtime_priority
 Strongly-typed realtime priority in the range $[1, 99]$. More...
 
struct  registered_thread
 Snapshot entry returned by thread_registry::snapshot. More...
 
class  scheduled_pool
 Scheduler that executes delayed and periodic tasks on worker threads. More...
 
class  scheduled_pool_config
 Builder-style configuration for scheduled_pool. More...
 
class  scheduled_task
 
class  scheduling_config
 Immutable scheduling request passed to thread creation/configuration APIs. More...
 
struct  task_error
 Captured information about a task failure. More...
 
class  thread
 Owning thread wrapper with result-based lifecycle/configuration API. More...
 
class  thread_affinity
 
class  thread_config
 Portable thread configuration bundle. More...
 
class  thread_id
 
class  thread_pool
 Fixed-size thread pool for queued asynchronous work. More...
 
class  thread_pool_config
 Builder-style configuration for thread_pool. More...
 
class  thread_registry
 Registry for named/configurable threads. More...
 
class  thread_view
 Non-owning view over a running thread or jthread. More...
 
struct  unexpect_t
 
class  unexpected
 
class  worker_count
 Value type for pool worker count. More...
 

Typedefs

template<typename T >
using result = expected< T, std::error_code >
 Standard result type used by public APIs.
 
using error_callback = std::function< void(task_error const &)>
 Callback signature for asynchronous task error reporting.
 

Enumerations

enum class  build_mode : std::uint8_t { header_only , runtime }
 Describes whether ThreadSchedule uses inline storage or its shared runtime. More...
 
enum class  scheduling_intent : std::uint8_t {
  background , normal , interactive , low_latency ,
  realtime_fifo , realtime_round_robin , nice
}
 Portable scheduling intents that map to platform-specific behavior. More...
 
enum class  priority_level : std::int8_t {
  lowest = 19 , low = 5 , normal = 0 , high = -5 ,
  highest = -20
}
 Portable non-realtime priority levels. More...
 
enum class  shutdown_policy : std::uint8_t { drain , drop_pending }
 Defines how pools handle pending work during shutdown. More...
 
enum class  worker_registration : std::uint8_t { disabled , global_registry }
 Controls whether pool workers are registered in a thread registry. More...
 

Functions

template<typename T , typename E >
void swap (expected< T, E > &lhs, expected< T, E > &rhs) noexcept(noexcept(lhs.swap(rhs)))
 
constexpr auto current_build_mode () noexcept -> build_mode
 
constexpr auto build_mode_string () noexcept -> char const *
 
auto global_registry () -> thread_registry &
 

Variables

constexpr unexpect_t unexpect {}
 
constexpr bool is_runtime_build = false
 

Typedef Documentation

◆ error_callback

using threadschedule::error_callback = typedef std::function<void(task_error const&)>

Callback signature for asynchronous task error reporting.

Definition at line 78 of file task_error.hpp.

◆ result

template<typename T >
using threadschedule::result = typedef expected<T, std::error_code>

Standard result type used by public APIs.

Template Parameters
TValue type on success.

On failure the error channel contains std::error_code.

Definition at line 22 of file result.hpp.

Enumeration Type Documentation

◆ build_mode

enum class threadschedule::build_mode : std::uint8_t
strong

Describes whether ThreadSchedule uses inline storage or its shared runtime.

Enumerator
header_only 

Header-only mode: implementation is compiled into each translation unit.

runtime 

Runtime mode: implementation is provided by the shared runtime library.

Definition at line 16 of file runtime.hpp.

◆ priority_level

enum class threadschedule::priority_level : std::int8_t
strong

Portable non-realtime priority levels.

Enumerator
lowest 
low 
normal 
high 
highest 

Definition at line 43 of file scheduling.hpp.

◆ scheduling_intent

enum class threadschedule::scheduling_intent : std::uint8_t
strong

Portable scheduling intents that map to platform-specific behavior.

Enumerator
background 

Prefer throughput and lower CPU contention over responsiveness.

normal 

Default scheduler behavior with balanced responsiveness.

interactive 

Favor responsiveness for user-facing work.

low_latency 

Favor low-latency execution where possible.

realtime_fifo 

Request POSIX FIFO realtime scheduling.

realtime_round_robin 

Request POSIX round-robin realtime scheduling.

nice 

Apply an explicit nice-level priority value.

Definition at line 24 of file scheduling.hpp.

◆ shutdown_policy

enum class threadschedule::shutdown_policy : std::uint8_t
strong

Defines how pools handle pending work during shutdown.

Enumerator
drain 

Finish queued work before returning from shutdown.

drop_pending 

Cancel/drop queued work that has not started yet.

Definition at line 16 of file shutdown_policy.hpp.

◆ worker_registration

enum class threadschedule::worker_registration : std::uint8_t
strong

Controls whether pool workers are registered in a thread registry.

Enumerator
disabled 

Do not register workers in the global registry.

global_registry 

Register workers in the global registry for discovery/control.

Definition at line 16 of file worker_registration.hpp.

Function Documentation

◆ build_mode_string()

constexpr auto threadschedule::build_mode_string ( ) -> char const*
inlineconstexprnoexcept

Definition at line 38 of file runtime.hpp.

References is_runtime_build.

◆ current_build_mode()

constexpr auto threadschedule::current_build_mode ( ) -> build_mode
inlineconstexprnoexcept

Definition at line 31 of file runtime.hpp.

References header_only.

◆ global_registry()

auto threadschedule::global_registry ( ) -> thread_registry&
inline

Definition at line 341 of file thread_registry.hpp.

◆ swap()

template<typename T , typename E >
void threadschedule::swap ( expected< T, E > &  lhs,
expected< T, E > &  rhs 
)
noexcept

Definition at line 1238 of file expected.hpp.

Variable Documentation

◆ is_runtime_build

constexpr bool threadschedule::is_runtime_build = false
inlineconstexpr

Definition at line 28 of file runtime.hpp.

Referenced by build_mode_string().

◆ unexpect

constexpr unexpect_t threadschedule::unexpect {}
inlineconstexpr

Definition at line 44 of file expected.hpp.