All of lore.kernel.org
 help / color / mirror / Atom feed
* Lock free ring buffers and SMP safety
@ 2007-11-18 17:31 Matt Bucknall
  2007-11-23 17:15 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Bucknall @ 2007-11-18 17:31 UTC (permalink / raw)
  To: alsa-devel

Hello,

Yes, this old chestnut. I've spent the best part of today trying to 
ascertain whether or not, in practical terms, a single-producer, 
single-consumer lock free ring-buffer can be written purely in C/C++ and 
be SMP safe on multiple architectures without memory barriers. 
Information I've found has been largely conflicting so I've given up 
trying to get a conclusive answer. Instead I'll just go with the flow.

What is the general consensus amongst ALSA application developers when 
it comes to implementing this kind of buffer? Is it possible to use 
memory barriers through some user space API call that I don't know about?

Thanks in advance for any comments/suggestions.
Matt.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Lock free ring buffers and SMP safety
  2007-11-18 17:31 Lock free ring buffers and SMP safety Matt Bucknall
@ 2007-11-23 17:15 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2007-11-23 17:15 UTC (permalink / raw)
  To: Matt Bucknall; +Cc: alsa-devel

At Sun, 18 Nov 2007 17:31:52 +0000,
Matt Bucknall wrote:
> 
> Hello,
> 
> Yes, this old chestnut. I've spent the best part of today trying to 
> ascertain whether or not, in practical terms, a single-producer, 
> single-consumer lock free ring-buffer can be written purely in C/C++ and 
> be SMP safe on multiple architectures without memory barriers. 
> Information I've found has been largely conflicting so I've given up 
> trying to get a conclusive answer. Instead I'll just go with the flow.
> 
> What is the general consensus amongst ALSA application developers when 
> it comes to implementing this kind of buffer? Is it possible to use 
> memory barriers through some user space API call that I don't know about?

Well, this question will be better answered on LAD, maybe.

AFAIK, the lock-free ringbuffer is possible in most architectures with
a help of memory barriers or atomic ops.  But these arch-specific
things are still headaches if you think of portability, of course.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-23 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-18 17:31 Lock free ring buffers and SMP safety Matt Bucknall
2007-11-23 17:15 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.