jnk0le / Ring-Buffer

simple C++11 ring buffer implementation, allocated and evaluated at compile time
MIT License
380 stars 64 forks source link

How to use for multi-consumer multi-producer #17

Open dsandber opened 3 years ago

dsandber commented 3 years ago

If I want a ring-buffer for the multi-producer multi-consumer case, and I protect access to the buffer with a mutex, am I correct that fake_tso should be true in the constructor and otherwise the defaults are correct?

Perhaps add this to the readme? I saw someone else asked about an exception in the MPMC case.

Thanks!

jnk0le commented 2 years ago

fake_tso is optimizaation for cases where the actual hardware (or effective useage) is defacto TSO but architecturally it's still WMO. Like single core microcontrollers.

Mutex should work, of course not as effective as proper MPMC.