<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 22, 2014 at 4:46 PM, Will Godfrey <span dir="ltr"><<a href="mailto:willgodfrey@musically.me.uk" target="_blank">willgodfrey@musically.me.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
As well as the jack ring buffer, I've looked at several others now, and their<br>
example code. The most significant thing that seems to be different about them<br>
(from a usage point of view) is the way they handle overflows. However, if the<br>
buffer size is defined as an exact multiple of the data type/structure and only<br>
complete structures are pushed or popped, would I be right in thinking that you<br>
would only need to check on an all/none basis?<br>
<br>
Have I missed something that could cause a partial data transfer?<br></blockquote><div><br>the jack ring buffers are byte-oriented, so you do have to be careful. however, if both the reader and writer only ever increment their respective pointer/index in multiples of the same basic byte count, then you should be OK. <br>
<br></div><div>if you use a C++ template ring buffer, then you necessarily cannot get partial transfers.<br></div></div></div></div>