SPMC_Queue
SPMC_Queue copied to clipboard
A simple and efficient single producer multiple consumer queue, suititable for both ITC and IPC.
Hi, Your SPMC_Queue is really inspiring! But it seems there's still a data racing issue. My test steps: 1. in multhread.cc, extend array size defined in struct Msg to make...
Nice code. But I have a question about the `next_idx`. What happens `next_idx` get overflowed into 0? The `read()` will always return null? ``` T* read() { auto& blk =...
7eee27b the latest change uses cast from T to std::atomic . However isn't it UB?
seems to me either one works
```cpp struct alignas(64) Block { uint32_t idx = 0; T data; } blks[CNT]; alignas(128) uint32_t write_idx = 0; ``` I'm wondering why alignas(128) is used here instead of alignas(64) or...