holoscan::LockFreeQueue
holoscan::LockFreeQueue
holoscan::LockFreeQueue
Lock-free queue implementation using MoodyCamel’s ConcurrentQueue.
This is a high-performance lock-free MPMC (Multiple Producer Multiple Consumer) queue that uses per-producer sub-queues for optimal concurrency.
Thread Safety:
Ordering Guarantees:
Performance Characteristics:
Template parameters
The type of elements stored in the queue
Inherits from: holoscan::DataLoggerQueue< T > (public)
Construct a lock-free queue with the specified capacity.
Parameters
The target maximum capacity (note: ConcurrentQueue treats this as a hint)
Attempt to enqueue an item (thread-safe).
Returns: true if successfully enqueued, false if queue is full
Parameters
The item to enqueue (will be moved)
Attempt to dequeue an item (thread-safe).
Returns: true if an item was dequeued, false if queue is empty
Parameters
Output parameter where the dequeued item will be moved
Get size of the queue (thread-safe).
Note: The accuracy of this value depends on the implementation:
LockFreeQueue: Returns an approximation that may be stale by the time it’s returnedReturns: Number of items in the queue (approximation or exact, depending on implementation)