A Portable Lock Free Bounded Queue
Attaining efficient and portable lock free containers is challenging as almost any CPU family implements slightly different memory models and atomic read modify write operations. C++11 offers a memory model and operation abstractions that enable portable implementations of non blocking algorithms. In this paper, we present a first scalable and portable lock free bounded queue supporting multiple readers and multiple writers. Our design uses unique empty values to decouple writing an element from incrementing the tail during enqueue. Dequeue employs a helping scheme that delays helping in the regular case, thereby reducing contention on shared memory. We evaluate our implementation on architectures featuring weak and strong memory consistency models. Our comparison with known blocking and lock free designs shows that the presented implementation scales well on architectures that implement a weak memory consistency model.
ICA3PP