4 ms·
A ring buffer can work for a single writer and multiple readers, in the model that each element is received by all the readers. Each reader just needs their own
by ambrop7 10y ago
A ring buffer can work for a single writer and multiple readers, in the model that each element is received by all the readers. Each reader just needs their own read index and the writer probably needs to check all the read indices before writing a new element, to ensure it doesn't overwrite data still being read.
And indeed it you want all readers to get all elements, I think a ring buffer is easier than a linked structure.