Re: [LAD] Code reordering

2016-03-04 Thread Fons Adriaensen
On Fri, Mar 04, 2016 at 10:16:02AM +0100, Sebastian Gesemann wrote: > As I said, I consider JACK's ringbuffer implementation to be broken. > According to the C11/C++11 memory model there is nothing in the code > that prevents reordering the update to write_ptr and the update to > *buf in

Re: [LAD] Realtime inter-thread communication

2016-03-04 Thread Kjetil Matheussen
> > Sebastian Gesemann: > @all: Thank you for your responses. I'm going to use my own ringbuffer > using C++11's std::atomics. > > Here are a couple of alternatives: http://portaudio.com/docs/v19-doxydocs-dev/pa__ringbuffer_8h.html http://www.boost.org/doc/libs/1_60_0/doc/html/lockfree.html

Re: [LAD] Code reordering

2016-03-04 Thread Kjetil Matheussen
On Fri, Mar 4, 2016 at 2:21 PM, Kjetil Matheussen wrote: > > > On Fri, Mar 4, 2016 at 2:12 PM, Paul Davis > wrote: > >> kjetil, thanks for the patch. >> >> however, the problem with fixing this problem has never been identifying >> where to

Re: [LAD] Code reordering

2016-03-04 Thread Kjetil Matheussen
On Fri, Mar 4, 2016 at 2:12 PM, Paul Davis wrote: > kjetil, thanks for the patch. > > 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

Re: [LAD] Code reordering

2016-03-04 Thread Paul Davis
kjetil, thanks for the patch. 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? On Fri, Mar 4, 2016 at 7:42 AM, Kjetil

Re: [LAD] Code reordering

2016-03-04 Thread Kjetil Matheussen
On Fri, Mar 4, 2016 at 1:22 PM, Kjetil Matheussen wrote: > You are right. There was even a discussion about how broken it was > in 2008, and it was fixed, at least in practice. > > http://lists.linuxaudio.org/pipermail/linux-audio-user/2008-October/056000.html > >

Re: [LAD] Linux-audio-dev Digest, Vol 109, Issue 4

2016-03-04 Thread Kjetil Matheussen
On Fri, Mar 4, 2016 at 1:00 PM, < linux-audio-dev-requ...@lists.linuxaudio.org> wrote: > Send Linux-audio-dev mailing list submissions to > linux-audio-dev@lists.linuxaudio.org > > To subscribe or unsubscribe via the World Wide Web, visit >

Re: [LAD] Code reordering

2016-03-04 Thread Sebastian Gesemann
On Wed, Mar 2, 2016 at 5:55 PM, Jonathan Brickman wrote: > On 3/1/2016 11:40 AM, Paul Davis wrote: > > > the JACK implementation relies on two things to work: > > > >* pointer and integer operations are (weakly) atomic on all platforms > > that JACK runs on > >*