|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Classes | |
| class | callable_eraser |
| Type eraser for heterogeneous callable storage. More... | |
| struct | compile_string |
| Compile-time string for template error messages. More... | |
| class | concurrent_queue |
| Thread-safe MPMC queue with blocking wait support (Internal implementation) More... | |
| struct | conditional_feature |
| Template for conditional compilation based on feature flags. More... | |
| struct | constexpr_string |
| Constexpr string utilities for compile-time job naming. More... | |
| struct | function_traits |
| Type trait for function signature analysis. More... | |
| struct | function_traits< R(*)(Args...) noexcept > |
| struct | function_traits< R(*)(Args...)> |
| struct | function_traits< R(C::*)(Args...) const > |
| struct | function_traits< R(C::*)(Args...)> |
| struct | future_value_type |
| Helper to get the value type from a future. More... | |
| class | global_reclamation_manager |
| Global manager for orphaned nodes from terminated threads. More... | |
| struct | has_bound_policy_tag |
| Detect if type has bound_policy_tag. More... | |
| struct | has_bound_policy_tag< T, std::void_t< typename T::policy_tag > > |
| struct | has_bound_policy_type |
| Detect if type has bound_policy_type member. More... | |
| struct | has_bound_policy_type< T, std::void_t< typename T::bound_policy_type > > |
| struct | has_do_work_method |
| SFINAE helper to detect if a type has a do_work method. More... | |
| struct | has_do_work_method< T, std::void_t< decltype(std::declval< T >().do_work())> > |
| struct | has_get_method |
| SFINAE helper to detect if a type has a specific member. More... | |
| struct | has_get_method< T, std::void_t< decltype(std::declval< T >().get())> > |
| struct | has_overflow_policy_tag |
| Detect if type has overflow_policy_tag. More... | |
| struct | has_overflow_policy_tag< T, std::void_t< typename T::policy_tag > > |
| struct | has_overflow_policy_type |
| Detect if type has overflow_policy_type member. More... | |
| struct | has_overflow_policy_type< T, std::void_t< typename T::overflow_policy_type > > |
| struct | has_priority_method |
| SFINAE helper to detect if a type has a specific member function. More... | |
| struct | has_priority_method< T, std::void_t< decltype(std::declval< T >().priority())> > |
| struct | has_sync_policy_tag |
| Detect if type has sync_policy_tag. More... | |
| struct | has_sync_policy_tag< T, std::void_t< typename T::policy_tag > > |
| struct | has_sync_policy_type |
| Detect if type has sync_policy_type member. More... | |
| struct | has_sync_policy_type< T, std::void_t< typename T::sync_policy_type > > |
| class | hazard_pointer_registry |
| Global hazard pointer registry Manages all thread-local hazard lists. More... | |
| struct | is_compatible_job |
| Compile-time job validation. More... | |
| struct | is_compatible_job< Job, ExpectedJobType > |
| struct | is_policy_queue_impl |
| Primary template: not a policy_queue. More... | |
| struct | is_policy_queue_impl< policy_queue< SyncPolicy, BoundPolicy, OverflowPolicy > > |
| Specialization for policy_queue template. More... | |
| class | job_eraser |
| Type erasure helper for heterogeneous job storage. More... | |
| struct | job_type_extractor |
| Template to extract job type from job classes. More... | |
| struct | job_type_extractor< T > |
| struct | job_type_list |
| Variadic template helper for job type lists. More... | |
| struct | job_type_traits |
| Type traits for job types. More... | |
| struct | job_validator |
| Compile-time job validation with detailed error messages. More... | |
| class | lockfree_job_queue |
| Lock-free Multi-Producer Multi-Consumer (MPMC) job queue (Internal implementation) More... | |
| struct | priority_comparator |
| Priority comparison helper with custom comparison functions. More... | |
| struct | retire_node |
| Retire node for pending deletion. More... | |
| struct | thread_hazard_list |
| Thread-local hazard pointer list Each thread maintains a small array of hazard pointers. More... | |
| class | thread_impl |
| Thread implementation abstraction that handles differences between std::jthread and std::thread. More... | |
| struct | validate_thread_count |
| Compile-time validation for thread pool configuration. More... | |
Typedefs | |
| template<typename F > | |
| using | function_return_t = typename function_traits<F>::return_type |
| Helper to get function traits. | |
| template<typename F > | |
| using | function_args_t = typename function_traits<F>::argument_types |
| template<typename Job > | |
| using | job_type_t = typename job_type_extractor<Job>::type |
| template<typename T , typename = std::enable_if_t<JobType<T>>> | |
| using | job_underlying_t = typename job_type_traits<T, void>::underlying_type |
| Type alias for job type conversion. | |
| template<typename Future > | |
| using | future_value_type_t = typename future_value_type<Future>::type |
Functions | |
| template<typename T > | |
| constexpr auto | forward_if_callable (T &&t) -> std::enable_if_t< Callable< T >, T && > |
| Template helper for perfect forwarding with type constraints. | |
| template<typename T > | |
| constexpr auto | get_type_name () |
| Template for generating descriptive error messages. | |
| template<typename F > | |
| constexpr auto | generate_job_name () |
| Template for automatic job naming based on function signature. | |
| template<typename JobType , typename... Args> | |
| constexpr auto | make_job_args (Args &&... args) |
| Perfect forwarding helper for job construction. | |
| template<typename T > | |
| constexpr bool | can_compare_priority () |
| Helper to determine if a type can be used as a job priority. | |
| template<typename T , typename = std::enable_if_t<JobType<T>>> | |
| constexpr bool | higher_priority (T lhs, T rhs) noexcept |
| Compile-time priority comparison. | |
| template<typename Container , typename Operation > | |
| auto | batch_apply (Container &&items, Operation &&op) |
| Apply an operation to each item in a collection, returning results. | |
| template<typename T > | |
| auto | collect_all (std::vector< std::future< T > > &futures) -> std::vector< T > |
| Collect all results from a vector of futures. | |
| void | collect_all (std::vector< std::future< void > > &futures) |
| Specialization of collect_all for void futures. | |
| template<std::size_t... Is, typename Tuple , typename ResultTuple > | |
| void | get_all_impl (std::index_sequence< Is... >, Tuple &futures, ResultTuple &results) |
| Index sequence helper for when_all implementation. | |
Variables | |
| template<typename F > | |
| constexpr bool | Callable = concepts::Callable<F> |
| template<typename F > | |
| constexpr bool | VoidCallable = concepts::VoidCallable<F> |
| template<typename F > | |
| constexpr bool | ReturningCallable = concepts::ReturningCallable<F> |
| template<typename F , typename... Args> | |
| constexpr bool | CallableWith = concepts::CallableWith<F, Args...> |
| template<typename T > | |
| constexpr bool | Duration = concepts::Duration<T> |
| template<typename T > | |
| constexpr bool | FutureLike = concepts::FutureLike<T> |
| template<typename T > | |
| constexpr bool | JobType = concepts::JobType<T> |
| template<typename F > | |
| constexpr bool | JobCallable = concepts::JobCallable<F> |
| template<typename Job > | |
| constexpr bool | PoolJob = concepts::PoolJob<Job> |
| template<typename F > | |
| constexpr size_t | function_arity_v = function_traits<F>::arity |
| template<typename T > | |
| constexpr bool | has_get_method_v = has_get_method<T>::value |
| template<typename T > | |
| constexpr bool | has_priority_method_v = has_priority_method<T>::value |
| template<typename T > | |
| constexpr bool | has_do_work_method_v = has_do_work_method<T>::value |
| template<typename Job , typename ExpectedJobType > | |
| constexpr bool | is_compatible_job_v = is_compatible_job<Job, ExpectedJobType>::value |
| using kcenon::thread::detail::function_args_t = typename function_traits<F>::argument_types |
Definition at line 83 of file pool_traits.h.
| using kcenon::thread::detail::function_return_t = typename function_traits<F>::return_type |
Helper to get function traits.
Definition at line 80 of file pool_traits.h.
| using kcenon::thread::detail::future_value_type_t = typename future_value_type<Future>::type |
Definition at line 37 of file when_helpers.h.
| using kcenon::thread::detail::job_type_t = typename job_type_extractor<Job>::type |
Definition at line 68 of file template_helpers.h.
| using kcenon::thread::detail::job_underlying_t = typename job_type_traits<T, void>::underlying_type |
Type alias for job type conversion.
Definition at line 105 of file type_traits.h.
| auto kcenon::thread::detail::batch_apply | ( | Container && | items, |
| Operation && | op ) |
Apply an operation to each item in a collection, returning results.
| Container | The input container type (must support range-based for) |
| Operation | Callable that takes Container::value_type and returns ResultType |
| items | Collection of items to process |
| op | Operation to apply to each item |
Definition at line 45 of file batch_operations.h.
Referenced by kcenon::thread::thread_pool::submit().

|
constexpr |
Helper to determine if a type can be used as a job priority.
Definition at line 74 of file type_traits.h.
References JobType.
| auto kcenon::thread::detail::collect_all | ( | std::vector< std::future< T > > & | futures | ) | -> std::vector<T> |
Collect all results from a vector of futures.
| T | The value type of the futures |
| futures | Vector of futures to collect from |
Blocks until all futures complete, collecting results in order.
Definition at line 83 of file batch_operations.h.
Referenced by kcenon::thread::thread_pool::submit_wait_all().

|
inline |
Specialization of collect_all for void futures.
| futures | Vector of void futures to wait on |
Blocks until all futures complete. Since void futures don't return values, this simply waits for completion.
Definition at line 103 of file batch_operations.h.
|
constexpr |
Template helper for perfect forwarding with type constraints.
Definition at line 109 of file pool_traits.h.
|
constexpr |
Template for automatic job naming based on function signature.
Definition at line 144 of file template_helpers.h.
| void kcenon::thread::detail::get_all_impl | ( | std::index_sequence< Is... > | , |
| Tuple & | futures, | ||
| ResultTuple & | results ) |
Index sequence helper for when_all implementation.
Definition at line 43 of file when_helpers.h.
Referenced by kcenon::thread::when_all().

|
constexpr |
Template for generating descriptive error messages.
Definition at line 195 of file pool_traits.h.
|
constexprnoexcept |
Compile-time priority comparison.
Definition at line 90 of file type_traits.h.
Referenced by kcenon::thread::typed_job_interface< job_type >::has_higher_priority().

|
constexpr |
Perfect forwarding helper for job construction.
Definition at line 225 of file template_helpers.h.
|
inlineconstexpr |
Definition at line 309 of file thread_concepts.h.
|
inlineconstexpr |
Definition at line 318 of file thread_concepts.h.
|
inlineconstexpr |
Definition at line 321 of file thread_concepts.h.
|
constexpr |
Definition at line 86 of file pool_traits.h.
|
inlineconstexpr |
Definition at line 324 of file thread_concepts.h.
|
constexpr |
Definition at line 47 of file template_helpers.h.
|
constexpr |
Definition at line 212 of file pool_traits.h.
|
constexpr |
Definition at line 34 of file template_helpers.h.
|
constexpr |
Definition at line 85 of file template_helpers.h.
|
inlineconstexpr |
Definition at line 330 of file thread_concepts.h.
|
inlineconstexpr |
Definition at line 327 of file thread_concepts.h.
Referenced by can_compare_priority().
|
inlineconstexpr |
Definition at line 333 of file thread_concepts.h.
|
inlineconstexpr |
Definition at line 315 of file thread_concepts.h.
|
inlineconstexpr |
Definition at line 312 of file thread_concepts.h.