Single-producer single-consumer
lastmod 2026-11-10created 2024-07-052 edits
Single-producer single-consumer (SPSC) refers to a queue structure with exactly one thread that puts data in and one thread that takes it out. Because each side has only one party, it can be implemented without locks using just two atomic indices, making it the simplest and fastest of the concurrent queues. It is distinguished from SPMC, MPSC, and MPMC, which have multiple producers or consumers.