[concurrency-interest] Quest for the optimal queue

Michael Barker mikeb01 at gmail.com
Sun May 13 07:00:17 EDT 2012


>> With most of the experimentation done on the Disruptor, the thing that
>> has the biggest impact on latency is how you notify the consumer
>> thread.
>
>
> There's no notification needed. If the consumer is currently active, i.e. is
> being executed by a thread, we want handoffs to be as cheap as possible.

Cool, you get to avoid the hard problem :-).

One possible thing to try would be to have some sort of batch based
dequeue operation rather than a single element dequeue.  If you
process a mailbox and there is 10 messages in the queue then you could
remove all 10 and update the head pointer only once.  I'm assuming
that the CAS/Volatile operations will be the biggest cost.  It won't
bring much of a single message latency reduction, but will have a
better profile under a heavy load or burst conditions.

Mike.


More information about the Concurrency-interest mailing list