iopipe v0.0.4 - RingBuffers!

Claude no at no.no
Mon May 14 15:07:52 UTC 2018


On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer 
wrote:
> However, I am struggling to find a use case for this that 
> showcases why you would want to use it. While it does work, and 
> works beautifully, it doesn't show any measurable difference 
> vs. the array allocated buffer that copies data when it needs 
> to extend.

I can think of a good use-case:
- Audio streaming (on embedded environment)!

If you have something like a bluetooth audio source, and alsa or 
any audio hardware API as an audio sink to speakers, you can use 
the ring-buffer as a fifo between the two.

The bluetooth source has its own pace (and you cannot control it) 
and has a variable bit-rate, whereas the sink has a constant 
bit-rate, so you have to have a buffer between them. And you want 
to reduce the CPU cost has much as possible due to embedded 
system constraints (or even real-time constraint, especially for 
audio).



More information about the Digitalmars-d-announce mailing list