Each producer and consumer must yield to other disruptor queue clients when an operation will not immediately succeed. This prevents overwriting of values and gives slower queue clients an opportunity to catch up. Custom yield stratgies must implement the following interface:
Yields control to other producer and consumer clients of the disruptor queue.
Varon-T has three built-in yielding strategies:
This simple yield strategy does a spin-loop while waiting for a queue operation that will succeed. This yield strategy requires each producer and consumer client execute in a separate thread.
This yield strategy uses a short spin-loop before yielding to other threads. It also requires each queue client execute in a separate thread.