Table of Contents

Interface IMessageQueue

Namespace
DotCompute.Abstractions.RingKernels
Assembly
DotCompute.Abstractions.dll

Non-generic base interface for GPU-resident message queues (used for reflection).

public interface IMessageQueue : IAsyncDisposable
Inherited Members

Remarks

This interface provides non-generic access to message queue properties and operations for scenarios requiring reflection or dynamic typing in ring kernel runtimes.

Properties

Capacity

Gets the queue capacity (maximum number of messages).

int Capacity { get; }

Property Value

int

Count

Gets the approximate current size of the queue.

int Count { get; }

Property Value

int

IsEmpty

Gets whether the queue is empty.

bool IsEmpty { get; }

Property Value

bool

IsFull

Gets whether the queue is full.

bool IsFull { get; }

Property Value

bool

Methods

ClearAsync(CancellationToken)

Clears all messages from the queue.

Task ClearAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

A task representing the clear operation.

GetBuffer()

Gets the memory buffer handle for GPU access.

IUnifiedMemoryBuffer GetBuffer()

Returns

IUnifiedMemoryBuffer

GetHeadPtr()

Gets the head pointer buffer (atomic counter for dequeue position).

IUnifiedMemoryBuffer GetHeadPtr()

Returns

IUnifiedMemoryBuffer

GetStatisticsAsync()

Gets queue statistics for monitoring.

Task<MessageQueueStatistics> GetStatisticsAsync()

Returns

Task<MessageQueueStatistics>

Queue statistics including message counts and throughput.

GetTailPtr()

Gets the tail pointer buffer (atomic counter for enqueue position).

IUnifiedMemoryBuffer GetTailPtr()

Returns

IUnifiedMemoryBuffer

InitializeAsync(CancellationToken)

Initializes the message queue and allocates GPU buffers.

Task InitializeAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

A task representing the initialization operation.