We introduce fast and scalable algorithms that implement bounded- and unbounded-size lock-free κ-FIFO queues on parallel, shared memory hardware. Logically, a κ-FIFO queue can be understood as queue where elements may be dequeued out-of-order up to κ - 1, or as pool where the oldest element is dequeued within at most k dequeue operations. The presented algorithms enable up to κ enqueue and κ dequeue operations to be performed in parallel. Unlike previous designs, however, the algorithms also implement linearizable emptiness (and full) checks without impairing scalability. We show experimentally that there exist optimal and robust κ that result in best access performance and scalability. We then demonstrate that our algorithms outperform and outscale all state-of-the-art concurrent pool and queue algorithms that we considered in all micro- and most macrobenchmarks. Moreover, we demonstrate a prototypical controller which identifies optimal κ automatically at runtime achieving better performance than with any statically configured κ.
展开▼