<div dir="ltr"><div>kjetil, thanks for the patch. <br><br></div>however, the problem with fixing this problem has never been identifying where to put the barriers, it has been adding them in a portable way. __atomic_* are, as far as i can tell, gcc-specific. am i wrong about that?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 4, 2016 at 7:42 AM, Kjetil Matheussen <span dir="ltr"><<a href="mailto:k.s.matheussen@gmail.com" target="_blank">k.s.matheussen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 4, 2016 at 1:22 PM, Kjetil Matheussen <span dir="ltr"><<a href="mailto:k.s.matheussen@gmail.com" target="_blank">k.s.matheussen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>You are right. There was even a discussion about how broken it was</div><div>in 2008, and it was fixed, at least in practice.</div><div><a href="http://lists.linuxaudio.org/pipermail/linux-audio-user/2008-October/056000.html" target="_blank">http://lists.linuxaudio.org/pipermail/linux-audio-user/2008-October/056000.html</a><br></div><div><br></div><div>Theoretically (and not unlikely also in practice), it seems to be still broken.</div><div>This can also confirmed by compiling with -fsanitize=thread:</div><div><br></div></div></div></div></blockquote><div><br></div><div>I made a quick fix: <a href="http://folk.uio.no/ksvalast/ringbuffer.diff" target="_blank">http://folk.uio.no/ksvalast/ringbuffer.diff</a></div><div><br></div><div>It can probably be optimized by relaxing some of the barrier strenghtnessness though,</div><div>but it probably makes no practical difference in execution time.</div><div>Perhaps apply this to jack, at least to avoid uncertainty about whether it will really</div><div>always work?</div><div><br></div></div></div></div>
<br>_______________________________________________<br>
Linux-audio-dev mailing list<br>
<a href="mailto:Linux-audio-dev@lists.linuxaudio.org">Linux-audio-dev@lists.linuxaudio.org</a><br>
<a href="http://lists.linuxaudio.org/listinfo/linux-audio-dev" rel="noreferrer" target="_blank">http://lists.linuxaudio.org/listinfo/linux-audio-dev</a><br>
<br></blockquote></div><br></div>