paper

Packed-Ring Queues: Lock-Free and Wait-Free Concurrent Queues on GPU

arXiv:2606.01693

Abstract

Concurrent queues are a foundational building block of parallel programming. On CPUs, decades of research have produced queue designs with well-understood correctness and progress guarantees -- from lock-free rings to wait-free constructions. On GPUs, where queues increasingly sit on the critical path of device-side task graphs and GPU-initiated I/O, no comparable foundation exists: SIMT execution serializes divergent retries across a warp; tens of thousands of threads contend on the same counter words; the double-width atomics that several CPU designs assume are absent; and GPU memory models are weakly ordered, so the classical algorithms do not transfer unchanged. We present the packed-ring queues (PRQs) -- two linearizable, bounded GPU queues that represent each compound atomic state in one native word of at most 64 bits: (1) PRQ-LF, a lock-free ring whose warp-batched fast path issues one atomic per warp on each of the queue's contended words, and (2) PRQ-WF, a wait-free ring in which peer threads cooperatively complete any operation that falls behind. To the best of our knowledge, PRQ-WF is the first GPU concurrent queue whose wait-freedom is proved as a theorem, with no assumption about how the GPU schedules threads. Across four GPUs from two vendors (NVIDIA A100 and GH200, AMD MI210 and MI300A), PRQ-LF outperforms the blocking Broker Queue by 5.0-20.4x at 32K threads, and PRQ-WF sustains throughput under producer/consumer imbalance where a prior design completes fewer than 0.1% of its attempts.