Re: Threading Question
Re: Threading Question
- Subject: Re: Threading Question
- From: Robert Chin <email@hidden>
- Date: Mon, 13 Feb 2012 10:29:41 -0800
On Mon, Feb 13, 2012 at 8:14 AM, Michael Tyson <email@hidden> wrote:
> Usually, I most definitely stick with tried-and-true, but in this case, oddly, I couldn't find a circular buffer implementation that I was happy with.
If all you need is one reader and you just need to pass messages and
don't need any of the special behaviors associated with a circular
buffer, you can also use a linked list and the existing
CAAtomicStack::push_atomic() and CAAtomicStack::pop_all_reversed().
I haven't actually tested the difference, but it has the theoretical
advantage over OSAtomicFifoEnqueue in that OSAtomicFifoEnqueue relies
on a PFZ code page (some more info at
http://www.opensource.apple.com/source/xnu/xnu-1504.7.4/osfmk/i386/commpage/fifo_queues.s),
although I would guess in the real world there is likely to be little
downside to using the built in OS call for most cases.
Robert
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden