We present a novel linearizable wait-free queue implementation using single-word CAS instructions. Previous lock-free queue implementations from CAS all have amortized step complexity of $\Omega(p)$ per operation in worst-case executions, where $p$ is the number of processes that access the queue. Our new wait-free queue takes $O(\log p)$ steps per enqueue and $O(\log^2 p +\log q)$ steps per dequeue, where $q$ is the size of the queue. A bounded-space version of the implementation has $O(\log p \log(p+q))$ amortized step complexity per operation.
翻译:我们提出了一种新颖的线性化无等待队列实现,采用单字CAS指令。先前基于CAS的无锁队列实现,在最坏情况执行中,每个操作的分摊步骤复杂度均为$\Omega(p)$,其中$p$为访问队列的进程数。本文提出的新无等待队列中,每次入队操作需$O(\log p)$步,每次出队操作需$O(\log^2 p +\log q)$步($q$为队列大小)。该实现的有界空间版本每个操作的平均步骤复杂度为$O(\log p \log(p+q))$。