.. /index

GPU Queues

GPU Queues

GPUs run 160,000+ concurrently active threads, have no coherent L1 caches, and execute in SIMT (Single Instruction Multiple Threads) lockstep across 32-thread warps. Every assumption built into a CPU lock-free queue breaks. CAS-based queues melt down catastrophically — one published benchmark shows a CAS-based queue running 1,112× slower than even a blocking array queue at high thread counts. The right answer is warp-centric queue design.

Why CPU queues don't translate

Warp-centric design

The dominant pattern aggregates operations within a warp before touching shared state:

  1. All 32 threads in a warp ballot whether they want to enqueue/dequeue.
  2. The warp leader performs one atomic claim for all participating threads' slots.
  3. Threads write/read their respective slots in parallel.

Up to 40× speedup over thread-centric designs in published benchmarks. The throughput regime is genuinely different: an LCRQ-family queue ported to NVIDIA K20c reached 201.8 million ops/s at 623 threads, an order of magnitude below CPU peak but on a vastly different parallelism model.

BACQ (2024)

Boundary-Aware Concurrent Queue (BACQ, 2024) is the current state of the art for GPU queues, achieving 2–9× improvement over existing GPU queue designs. Its key insight is that GPU queue performance is dominated by the boundary between full and empty states — most contention happens when the queue is near a transition point, and treating the boundary explicitly (rather than as a special case of normal operation) lets it batch operations more aggressively.

Practical implications

See also

Linked from

Sources