4 ms·
Interesting variation on circular queue. It looks like it is mostly useful when the size of the data chunk varies, but the consumer never reads across the bound
by pavon 5y ago
Interesting variation on circular queue. It looks like it is mostly useful when the size of the data chunk varies, but the consumer never reads across the boundry of a chunk. Something like variable length packets/messages would be a good fit. If the data chunk size was fixed, you could just size you circular queue to be a multiple of that. And I can't think of anyway to ensure contiguous memory if the consumers' read sizes are not aligned with the producer's write sizes something I encounter frequently with streaming data architectures (like gnuradio for example) where the ideal chunk size varies between the different algorithms in different processing nodes in the pipeline.