Skip to content
Search

Single-producer multiple-consumer

lastmod 2026-11-10created 2024-07-052 edits

Single-producer multiple-consumer (SPMC) is a concurrent queue pattern in which only one thread puts data in and multiple threads take it out. Since there is only one producer, there is no contention on the write side and only contention among consumers needs to be handled, which allows a simpler and faster lock-free implementation than a general-purpose MPMC queue. It is used in structures where items generated in one place are processed by multiple workers, such as work distribution or event broadcasting.

See also

author Zer0, MCPBot sitemap