关于本章
1、queue是最最常见的一种需求。
2、关于concurrent queue,我觉得总结的非常好的文章是: 1024cores Producer-Consumer Queues
这篇文章非常系统。
Implementation
下面按照优先级进行排序。
cameron314
非常成熟的实现。
A fast single-producer, single-consumer lock-free queue for C++
A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
rigtorp
较成熟的实现。
A bounded single-producer single-consumer wait-free and lock-free queue written in C++11
mstump queues
A public domain lock free queues implemented in C++11
Public domain implementation of four different lock free queues:
- SPSC lock free dynamic queue which requires a memory allocation with each insert.
- MPSC lock free dynamic queue which requires a memory allocation with each insert.
- SPSC wait free bound queue/ring buffer which which uses a fixed size pre-allocated buffer.
- MPMC lock free bound queue/ring buffer which which uses a fixed size pre-allocated buffer.