|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
Mixin interface for queue capability introspection. More...
#include <queue_capabilities_interface.h>


Public Member Functions | |
| virtual | ~queue_capabilities_interface ()=default |
| virtual auto | get_capabilities () const -> queue_capabilities |
| Get capabilities of this queue implementation. | |
| auto | has_exact_size () const -> bool |
| Check if size() returns exact values. | |
| auto | has_atomic_empty () const -> bool |
| Check if empty() check is atomic. | |
| auto | is_lock_free () const -> bool |
| Check if this is a lock-free implementation. | |
| auto | is_wait_free () const -> bool |
| Check if this is a wait-free implementation. | |
| auto | supports_batch () const -> bool |
| Check if batch operations are supported. | |
| auto | supports_blocking_wait () const -> bool |
| Check if blocking wait is supported. | |
| auto | supports_stop () const -> bool |
| Check if stop signaling is supported. | |
Mixin interface for queue capability introspection.
This interface provides runtime capability queries for queue implementations. Classes can optionally inherit from this to expose their capabilities, enabling consumers to adapt their behavior accordingly.
This is an additive interface. Existing code that doesn't use this interface continues to work unchanged. New code can optionally check for capabilities using dynamic_cast or other type checking mechanisms.
All methods in this interface are const and return by value, making them inherently thread-safe. Implementations should not introduce mutable state.
Definition at line 50 of file queue_capabilities_interface.h.
|
virtualdefault |
|
inlinenodiscardvirtual |
Get capabilities of this queue implementation.
Returns capabilities matching mutex-based job_queue behavior, ensuring backward compatibility for implementations that don't override.
Reimplemented in kcenon::thread::adaptive_job_queue, kcenon::thread::detail::lockfree_job_queue, kcenon::thread::job_queue, and kcenon::thread::policy_queue< SyncPolicy, BoundPolicy, OverflowPolicy >.
Definition at line 62 of file queue_capabilities_interface.h.
Referenced by has_atomic_empty(), has_exact_size(), is_lock_free(), is_wait_free(), supports_batch(), supports_blocking_wait(), and supports_stop().

|
inlinenodiscard |
Check if empty() check is atomic.
Definition at line 80 of file queue_capabilities_interface.h.
References get_capabilities().

|
inlinenodiscard |
Check if size() returns exact values.
Lock-free queues may return approximate sizes due to concurrent modifications.
Definition at line 72 of file queue_capabilities_interface.h.
References get_capabilities().

|
inlinenodiscard |
Check if this is a lock-free implementation.
Lock-free implementations provide better performance under high contention but may have different semantics for size/empty checks.
Definition at line 91 of file queue_capabilities_interface.h.
References get_capabilities().

|
inlinenodiscard |
Check if this is a wait-free implementation.
Wait-free is a stronger guarantee than lock-free, ensuring bounded execution time for all operations regardless of contention.
Definition at line 102 of file queue_capabilities_interface.h.
References get_capabilities().

|
inlinenodiscard |
Check if batch operations are supported.
Definition at line 110 of file queue_capabilities_interface.h.
References get_capabilities().

|
inlinenodiscard |
Check if blocking wait is supported.
Definition at line 118 of file queue_capabilities_interface.h.
References get_capabilities().

|
inlinenodiscard |
Check if stop signaling is supported.
Definition at line 126 of file queue_capabilities_interface.h.
References get_capabilities().
