Re: [LAD] a *simple* ring buffer, comments pls?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Audio Developers <linux-audio-dev@...>
Date: Friday, July 8, 2011 - 12:51 am

On 7 July 2011 13:10, James Morris wrote:

I didn't have time to test it before going to work, when posting
earlier, but was hoping someone who might see something immediately
wrong with it might comment. I'm mainly posting back to say it doesn't
work.

It does mostly work, but not always, which is as good as not working
at all. It looses the occasional write. For example my test program
has two threads and two buffers. The first buffer is used for thread 1
to send data to thread 2, and the second is used to send it back
again. With 70 items originating in thread 1, and both buffers large
enough to hold 32 items, 1 item is lost perhaps 1 in 7 program
executions.

I thought a "lock-free" ring buffer was supposed to be the easy solution!

James.

>

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] a *simple* ring buffer, comments pls?, James Morris, (Thu Jul 7, 12:10 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, James Morris, (Fri Jul 8, 12:51 am)
Re: [LAD] a *simple* ring buffer, comments pls?, James Morris, (Fri Jul 8, 11:24 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Fri Jul 8, 1:22 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Fri Jul 8, 5:17 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Gabriel M. Beddingfield, (Fri Jul 8, 6:12 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Arnold Krille, (Fri Jul 8, 7:06 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Fri Jul 8, 7:53 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Fri Jul 8, 8:41 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Fri Jul 8, 9:01 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Arnold Krille, (Fri Jul 8, 8:59 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Fri Jul 8, 9:11 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Fri Jul 8, 7:23 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Mon Jul 11, 6:59 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Mon Jul 11, 8:53 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Tue Jul 12, 5:41 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Kegel, (Fri Jul 8, 7:29 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Fri Jul 8, 8:49 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Sean Bolton, (Fri Jul 8, 9:57 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Fri Jul 8, 11:03 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Fri Jul 8, 11:27 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Sat Jul 9, 1:25 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Sat Jul 9, 2:38 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Sun Jul 10, 3:05 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Sun Jul 10, 9:15 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Mon Jul 11, 12:03 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Mon Jul 11, 8:44 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Kegel, (Sun Jul 10, 10:34 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Sun Jul 10, 9:41 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Sean Bolton, (Mon Jul 11, 1:34 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Sean Bolton, (Mon Jul 11, 1:44 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Mon Jul 11, 7:19 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, James Morris, (Mon Jul 11, 8:32 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Chris Cannam, (Mon Jul 11, 8:50 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Tim E. Real, (Mon Jul 11, 9:38 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Robin Gareus, (Mon Jul 11, 10:27 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Arnold Krille, (Mon Jul 11, 10:12 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Robin Gareus, (Mon Jul 11, 10:28 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Mon Jul 11, 10:34 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Mills, (Mon Jul 11, 10:24 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Mon Jul 11, 10:06 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Mon Jul 11, 11:06 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Mon Jul 11, 10:17 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Mon Jul 11, 8:58 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Chris Cannam, (Tue Jul 12, 7:07 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Muresan, (Tue Jul 12, 12:44 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Kai Vehmanen, (Wed Jul 20, 9:25 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Emanuel Rumpf, (Sat Aug 20, 6:24 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Emanuel Rumpf, (Sat Aug 27, 7:21 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Gabriel Beddingfield, (Sat Aug 20, 7:16 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Chris Cannam, (Tue Jul 12, 7:46 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Tue Jul 12, 8:20 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Arnold Krille, (Tue Jul 12, 11:31 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Tue Jul 12, 11:56 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Wed Jul 13, 12:27 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Chris Cannam, (Tue Jul 12, 9:07 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Tue Jul 12, 9:26 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Paul Davis, (Tue Jul 12, 8:36 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Tue Jul 12, 9:32 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Kegel, (Tue Jul 12, 10:23 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Tue Jul 12, 11:50 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fred Gleason, (Wed Jul 13, 12:08 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Wed Jul 13, 12:25 am)
Re: [LAD] a *simple* ring buffer, comments pls?, Chris Cannam, (Tue Jul 12, 9:37 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Tue Jul 12, 10:00 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Chris Cannam, (Tue Jul 12, 9:16 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Emanuel Rumpf, (Tue Jul 12, 5:20 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Chris Cannam, (Mon Jul 11, 8:50 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, David Olofson, (Mon Jul 11, 8:47 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Dan Kegel, (Fri Jul 8, 9:52 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Fons Adriaensen, (Fri Jul 8, 6:39 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, James Morris, (Fri Jul 8, 12:21 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Olivier Guilyardi, (Fri Jul 8, 12:56 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, Gabriel M. Beddingfield, (Fri Jul 8, 1:04 am)
Re: [LAD] a *simple* ring buffer, comments pls?, David Robillard, (Fri Jul 8, 2:23 pm)
Re: [LAD] a *simple* ring buffer, comments pls?, James Morris, (Fri Jul 8, 8:45 am)
Re: [LAD] a *simple* ring buffer, comments pls?, James Morris, (Fri Jul 8, 8:40 am)