Table of Contents

Enum RingProcessingMode

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

Specifies how a ring kernel processes messages from its input queue.

public enum RingProcessingMode

Fields

Adaptive = 2

Dynamically switch between Continuous and Batch based on queue depth.

In Adaptive mode, the ring kernel monitors its input queue depth and switches processing strategy dynamically:

  • Low queue depth (< threshold): Process single messages (Continuous mode)
  • High queue depth (≥ threshold): Process batches (Batch mode)
This provides the best of both worlds - low latency when queue is shallow, high throughput when queue is deep. Recommended for most workloads with variable message arrival rates.
Batch = 1

Process multiple messages per iteration for maximum throughput.

In Batch mode, the ring kernel processes multiple messages (up to a configured batch size) per dispatch loop iteration. This maximizes message throughput by amortizing kernel dispatch overhead across multiple messages. Best for high-volume data processing where individual message latency is less important than overall throughput.

Continuous = 0

Process one message per iteration for minimum latency.

In Continuous mode, the ring kernel processes a single message per dispatch loop iteration. This minimizes end-to-end message latency at the cost of lower peak throughput. Best for latency-critical applications like actor request-response patterns or real-time event processing.

Remarks

Ring kernels can operate in different processing modes to optimize for either latency or throughput depending on the workload characteristics.

Continuous Mode processes one message at a time with minimal latency overhead, ideal for latency-sensitive applications like real-time actor systems.

Batch Mode processes multiple messages per iteration to maximize throughput, suitable for high-volume message processing where latency is less critical.

Adaptive Mode dynamically switches between continuous and batch processing based on queue depth, providing a balance between latency and throughput.