Re: [LAU] Simple, easy multithreaded circular buffer library for Linux?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Olivier Guilyardi <ml@...>
Cc: A list for linux audio users <linux-audio-user@...>
Date: Friday, October 17, 2008 - 6:02 pm

Olivier Guilyardi wrote:

excuse my chiming in here, i'm not really much of a c programmer... but
how can this
- rb->read_ptr += n1;
- rb->read_ptr &= rb->size_mask;
+ rb->read_ptr = (rb->read_ptr + n1) & rb->size_mask;
fix anything?

iiuc, both versions are equivalent. a context switch could happen just
as well after the parenthesis has been computed..!?
putting stuff on one line doesn't make it atomic. maybe you are now
getting another compiler optimization that helps to hide the bug?

no offense, just trying to learn something...

jörn

--
jörn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

Kurt is up in Heaven now.
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user

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

Messages in current thread:
Re: [LAU] Simple, easy multithreaded circular buffer library..., Kjetil S. Matheussen, (Tue Oct 14, 4:39 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Tue Oct 14, 9:01 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Wed Oct 15, 11:03 am)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Wed Oct 15, 11:49 am)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Fri Oct 17, 12:13 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Fri Oct 17, 5:20 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Joern Nettingsmeier, (Fri Oct 17, 6:02 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Joern Nettingsmeier, (Sat Oct 18, 5:08 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Joern Nettingsmeier, (Fri Oct 17, 7:22 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Joern Nettingsmeier, (Fri Oct 17, 10:32 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Fri Oct 17, 6:37 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Fri Oct 17, 5:45 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Fri Oct 17, 2:39 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Sun Oct 19, 11:03 am)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Fri Oct 17, 5:35 pm)
[LAU] [LAA] gxtuner-1.6 update, hermann, (Sun Dec 11, 8:20 am)
Re: [LAU] [LAD] gxtuner-1.6 update, hermann, (Wed Dec 14, 1:29 pm)
[LAU] gxtuner-1.5 released, hermann, (Fri Dec 9, 11:17 am)
Re: [LAU] [LAD] gxtuner-1.5 released, Jostein Chr. Andersen, (Fri Dec 9, 2:43 pm)
Re: [LAU] [LAD] gxtuner-1.5 released, hermann, (Fri Dec 9, 3:30 pm)
Re: [LAU] [LAD] gxtuner-1.5 released, Jostein Chr. Andersen, (Fri Dec 9, 8:28 pm)
Re: [LAU] [LAD] gxtuner-1.5 released, Gerhard Zintel, (Sat Dec 10, 12:17 pm)
Re: [LAU] [LAD] gxtuner-1.5 released, Jostein Chr. Andersen, (Sat Dec 10, 11:14 pm)
Re: [LAU] [LAD] gxtuner-1.5 released, Jostein Chr. Andersen, (Sat Dec 10, 11:07 pm)
Re: [LAU] [LAD] gxtuner-1.5 released, hermann, (Fri Dec 9, 9:29 pm)
Re: [LAU] [LAA] [ANN] guitarix release guitarix2-0.18.0, Jeremy Jongepier, (Tue Sep 6, 11:23 am)
[LAU] update release gxtuner-1.3, hermann, (Thu Jul 28, 7:56 am)
[LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Sun Jul 24, 11:12 am)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, R.Wolff, (Mon Jul 25, 11:12 am)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Mon Jul 25, 5:54 pm)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, allcoms, (Wed Jul 27, 10:08 am)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Wed Jul 27, 11:06 am)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, allcoms, (Wed Jul 27, 2:33 pm)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Wed Jul 27, 6:04 pm)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Wed Jul 27, 2:54 pm)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, Fons Adriaensen, (Wed Jul 27, 10:13 am)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Wed Jul 27, 11:19 am)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, Fons Adriaensen, (Wed Jul 27, 11:58 am)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Wed Jul 27, 12:49 pm)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, Fons Adriaensen, (Wed Jul 27, 2:21 pm)
Re: [LAU] [LAA] [ANN] release gxtuner-1.0, hermann, (Wed Jul 27, 3:14 pm)
Re: [LAU] [LAA] [ANN] guitarix release guitarix2-0.17.0, Alexandre Prokoudine, (Sat Jul 9, 6:50 pm)
[LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Fri Jan 14, 8:36 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Mon Jan 17, 11:13 am)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, Mark Knecht, (Sun Jan 16, 6:31 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Sun Jan 16, 8:22 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, Ivan Tarozzi, (Sun Jan 16, 7:04 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, Ivan Tarozzi, (Sun Jan 16, 6:18 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, Ivan Tarozzi, (Mon Jan 17, 1:35 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Tue Jan 18, 6:53 am)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Sun Jan 16, 8:04 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, Jeremy Jongepier, (Sun Jan 16, 10:08 am)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Sun Jan 16, 11:48 am)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Sun Jan 16, 8:08 pm)
Re: [LAU] [LAA] [ANN] guitarix released gx_head, hermann, (Sun Jan 16, 8:25 pm)
[LAU] [LAA] [ANN] guitarix-0.10.0 released, hermann, (Sun Jul 11, 4:45 am)
[LAU] guitarix-0.08.0 release 'Rockers', hermann, (Fri May 14, 2:44 pm)
[LAU] [LAA] [ANN] guitarix-0.06.0 bugfix release, hermann, (Thu Feb 18, 8:08 pm)
[LAU] [LAA] [ANN] guitarix-0.05.9-1 release, hermann, (Thu Feb 18, 6:11 am)
[LAU] [LAA] [ANN] guitarix-0.05.6-1 released, hermann, (Fri Jan 1, 11:44 am)
[LAU] [LAA] [ANN] guitarix-0.05.2-1 released, hermann, (Sun Dec 13, 10:45 am)
[LAU] [LAA] [ANN] guitarix-0.05.2-1 released, hermann, (Mon Nov 30, 12:44 pm)
Re: [LAU] [LAA] [ANN] guitarix-0.05.2-1 released, Hartmut Noack, (Thu Dec 3, 1:05 pm)
[LAU] [ANN] guitarix-0.05.1-1 released, hermann, (Mon Oct 26, 7:52 am)
[LAU] [LAA] [ANN] guitarix-0.05.0-1 released, hermann, (Mon Jul 27, 8:14 am)
[LAU] [LAA] [ANN] guitarix-0.04.6-1 release, hermann meyer, (Wed Jun 24, 3:03 pm)
Re: [LAU] [LAA] [ANN] guitarix-0.04.6-1 release, Dragan Noveski, (Wed Jun 24, 3:49 pm)
Re: [LAU] [LAA] [ANN] guitarix-0.04.6-1 release, hermann meyer, (Wed Jun 24, 4:22 pm)
[LAU] [ANN] guitarix-0.03.9-1 bugfix release, hermann meyer, (Thu Mar 26, 7:52 pm)
[LAU] [ANN] guitarix release version 0.03.8-1, hermann meyer, (Wed Mar 18, 7:00 pm)
[LAU] [ANN] guitarix third release, hermann meyer, (Sun Nov 23, 5:19 pm)
Re: [LAU] [ANN] guitarix third release, Dragan Noveski, (Tue Nov 25, 1:18 pm)
Re: [LAU] [ANN] guitarix third release, hermann meyer, (Tue Nov 25, 2:34 pm)
Re: [LAU] [ANN] guitarix third release, Dragan Noveski, (Wed Nov 26, 2:07 am)
[LAU] [ANN] guitarix second release, hermann meyer, (Sun Nov 2, 3:35 pm)
Re: [LAU] [ANN] guitarix second release, David Baron, (Sun Nov 2, 6:39 pm)
Re: [LAU] [ANN] guitarix second release, Fons Adriaensen, (Sun Nov 2, 8:18 pm)
Re: [LAU] [ANN] guitarix second release, hermann meyer, (Sun Nov 2, 6:52 pm)
Re: [LAU] [ANN] guitarix second release, Dragan Noveski, (Sun Nov 2, 4:41 pm)
Re: [LAU] [ANN] guitarix second release, hermann meyer, (Sun Nov 2, 4:58 pm)
Re: [LAU] [ANN] guitarix second release, Dragan Noveski, (Sun Nov 2, 5:44 pm)
Re: [LAU] [ANN] guitarix second release, Julien Claassen, (Sun Nov 2, 3:59 pm)
Re: [LAU] [ANN] guitarix second release, hermann meyer, (Sun Nov 2, 4:35 pm)
Re: [LAU] [ANN] guitarix second release, Julien Claassen, (Sun Nov 2, 6:30 pm)
Re: [LAU] [ANN] guitarix second release, Darren Landrum, (Sun Nov 2, 3:53 pm)
Re: [LAU] [ANN] guitarix second release, hermann meyer, (Sun Nov 2, 4:30 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Joern Nettingsmeier, (Fri Oct 17, 3:38 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Kjetil S. Matheussen, (Fri Oct 17, 3:01 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Olivier Guilyardi, (Fri Oct 17, 3:16 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Kjetil S. Matheussen, (Fri Oct 17, 3:31 pm)
Re: [LAU] Simple, easy multithreaded circular buffer library..., Kjetil S. Matheussen, (Fri Oct 17, 12:26 pm)