
i just went through the replies ... (maybe i should upcase some parts in the documentation, that the implementation focus on WORST CASE, not AVERAGE CASE performance ... people keep complaining that the stack/fifo may be outperformed be blocking algorithms, which is both true and irrelevant for me, as these implementations are soft real-time safe (and could be made hard real-time safe).
Agreed. Are you planning to augment your library with algorithms for different needs? Like MPSC, SPMC and so forth? I think that could be useful, because it looks like implementing the most generic MPMC case won't give you the best results.
i just added a lock-free single-producer/single-consumer ringbuffer to my git repository, branch topic/spsc_ringbuffer ... it implements an algorithm, that is commonly found in open source audio applications ... performs about 8 times faster than the m-s fifo queue (which is based on linked lists). it comes in two versions: template <typename T, size_t size> class ringbuffer; template <typename T> class ringbuffer<T, 0>; in the first version the size is set at compile time, in the second version at run time (during the construction). tim -- tim@klingt.org http://tim.klingt.org You can play a shoestring if you're sincere John Coltrane