For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Introduction
    • Overview
    • Relevant Technologies
    • Getting Started
  • Setup
    • SDK Installation
    • Additional Setup
    • Third Party Hardware Setup
  • Using the SDK
    • Holoscan Core
    • GPU Resident Execution
    • Holoscan by Example
    • Create an Application
    • Create a Distributed Application
    • Create an Operator
    • Create an Operator via Decorator
    • Create a Condition
    • Dynamic Flow Control
    • CUDA Stream Handling
    • Logging
    • Data Logging
    • Debugging
    • Python Operator Bindings
  • Operators
    • Operators and Extensions
    • Visualization
    • Inference
    • Testing
    • Video I/O Vendor Implementation Guide
  • Components
    • Schedulers
    • Conditions
    • Resources
    • Analytics
  • AI Skills
    • Ai Skills
  • API reference
          • Allocator
          • AnnotatedDoubleBufferReceiver
          • AnnotatedDoubleBufferTransmitter
          • AppDriver
          • Application
          • AppWorker
          • Arg
          • ArgList
          • ArgType
          • ArgumentSetter
          • AsyncBufferReceiver
          • AsyncBufferTransmitter
          • AsyncDataLoggerBackend
          • AsyncDataLoggerResource
          • AsynchronousCondition
          • BlockMemoryPool
          • BooleanCondition
          • CLIParser
          • Clock
          • ClockInterface
          • CodecRegistry
          • Component
          • ComponentBase
          • ComponentSpec
          • Condition
          • ConditionCombiner
          • Config
          • CountCondition
          • CPUResourceMonitor
          • CPUThread
          • CsvDataExporter
          • CudaAllocator
          • CudaBufferAvailableCondition
          • CudaContextScopedPush
          • CudaEventCondition
          • CudaFunctionLauncher
          • CudaGreenContext
          • CudaGreenContextPool
          • CudaObjectHandler
          • CudaStreamCondition
          • CudaStreamHandler
          • CudaStreamPool
          • DataExporter
          • DataFlowTracker
          • DataLogger
          • DataLoggerQueue
          • DataLoggerResource
          • DefaultFragmentService
          • DFFTCollector
          • DistributedAppService
          • DLManagedMemoryBufferVersioned
          • DoubleBufferReceiver
          • DoubleBufferTransmitter
          • DownstreamMessageAffordableCondition
          • Endpoint
          • EventBasedScheduler
          • ExecutionContext
          • Executor
          • ExpiringMessageAvailableCondition
          • ExtensionManager
          • FastDdsDiscovery
          • FastDdsEndpoint
          • FastDdsHoloscanEntityTypeSupport
          • FastDdsNativeBufferAdapter
          • FastDdsPubSubContext
          • FastDdsPubSubNetworkContext
          • FastDdsSerializer
          • FastDdsTransport
          • FileFIFOMutex
          • FirstFitAllocator
          • FirstFitAllocatorBase
          • FirstPixelOutCondition
          • FlowGraph
          • FlowGraphImpl
          • Fragment
          • FragmentAllocationStrategy
          • FragmentScheduler
          • FragmentService
          • FragmentServiceProvider
          • GPUDevice
          • GPUResidentDeck
          • GPUResidentExecutor
          • GPUResidentOperator
          • GPUResourceMonitor
          • GreedyFragmentAllocationStrategy
          • GreedyScheduler
          • GXFComponentResource
          • HoloEntitySerializerBase
          • HoloIpcCudaNativeBufferAdapterBase
          • HoloscanAsyncBufferReceiver
          • HoloscanAsyncBufferTransmitter
          • HoloscanLogger
          • HoloscanUcxReceiver
          • HoloscanUcxTransmitter
          • InMemoryPubSubNetworkContext
          • InMemoryPubSubSession
          • InputContext
          • IOSpec
          • LockFreeQueue
          • Logger
          • ManualClock
          • Map
          • MatXAllocator
          • MemoryAvailableCondition
          • Message
          • MessageAvailableCondition
          • MessageLabel
          • MetadataDictionary
          • MetaParameter
          • MultiMessageAvailableCondition
          • MultiMessageAvailableTimeoutCondition
          • MultiThreadScheduler
          • NativeBufferProtocolAdapter
          • NetworkContext
          • Nullable
          • Operator
          • OperatorSpec
          • OrConditionCombiner
          • OrderedQueue
          • OutputContext
          • ParameterWrapper
          • PathMetrics
          • PeriodicCondition
          • PoseTree
          • PoseTreeEdgeHistory
          • PoseTreeManager
          • PoseTreeUCXClient
          • PoseTreeUCXServer
          • PresentDoneCondition
          • PublisherAvailableCondition
          • PubSubContext
          • PubSubReceiver
          • PubSubTransmitter
          • RealtimeClock
          • Receiver
          • Resource
          • RMMAllocator
          • RuntimeError
          • Scheduler
          • ScopedFlock
          • ScopedWaitedFlock
          • SerializationBuffer
          • SessionDiscoveryFrontend
          • SessionTransportFrontend
          • SidecarDispatchQueue
          • SignalHandler
          • SO2
          • SO3
          • StdComponentSerializer
          • StdEntitySerializer
          • StdPubSubEntitySerializer
          • StreamOrderedAllocator
          • Subgraph
          • SubscriberAvailableCondition
          • SyntheticClock
          • SystemResourceManager
          • Tensor
          • TensorMap
          • ThreadPool
          • Timer
          • Topology
          • Transmitter
          • UcxComponentSerializer
          • UcxContext
          • UcxEntitySerializer
          • UcxHoloscanComponentSerializer
          • UcxReceiver
          • UcxSerializationBuffer
          • UcxTransmitter
          • UnboundedAllocator
  • Performance
    • Performance Considerations
    • Flow Tracking
    • GXF Job Statistics
    • Nsight Profiling
  • HoloHub
    • HoloHub Overview
  • FAQ
    • FAQ
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogoDocumentation
On this page
  • Constructors
  • LockFreeQueue
  • Methods
  • try_enqueue
  • try_dequeue
  • size_approx
  • Member variables
API referenceC++ APIHoloscanClasses

holoscan::LockFreeQueue

Beta
||View as Markdown|
Previous

holoscan::IOSpec

Next

holoscan::Logger

template <typename T>
class 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:

  • Fully thread-safe for concurrent enqueue and dequeue operations
  • No locks or blocking operations (wait-free for producers, lock-free for consumers)
  • Safe to call from multiple threads simultaneously

Ordering Guarantees:

  • Maintains FIFO order per-producer (items from the same thread stay ordered)
  • Does NOT guarantee global FIFO order across multiple producers
  • Items from different threads may be interleaved in any order

Performance Characteristics:

  • Excellent throughput with minimal contention
  • size_approx() returns an estimate that may be stale immediately after return
#include <holoscan/data_logger_queue.hpp>

Template parameters

T
typename

The type of elements stored in the queue

Inherits from: holoscan::DataLoggerQueue< T > (public)


Constructors

LockFreeQueue

holoscan::LockFreeQueue<T>::LockFreeQueue(holoscan::LockFreeQueue<T>::LockFreeQueue(
size_t capacity
)

Construct a lock-free queue with the specified capacity.

Parameters

capacity
size_t

The target maximum capacity (note: ConcurrentQueue treats this as a hint)


Methods

try_enqueue

bool holoscan::LockFreeQueue<T>::try_enqueue(
T &&item
) override

Attempt to enqueue an item (thread-safe).

Returns: true if successfully enqueued, false if queue is full

Parameters

item
T &&

The item to enqueue (will be moved)

try_dequeue

bool holoscan::LockFreeQueue<T>::try_dequeue(
T &item
) override

Attempt to dequeue an item (thread-safe).

Returns: true if an item was dequeued, false if queue is empty

Parameters

item
T &

Output parameter where the dequeued item will be moved

size_approx

size_t holoscan::LockFreeQueue<T>::size_approx() const override

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 returned
  • OrderedQueue: Returns the exact size at the moment the mutex was acquired

Returns: Number of items in the queue (approximation or exact, depending on implementation)


Member variables

NameTypeDescription
queue_moodycamel::ConcurrentQueue< T >