Re: AudioUnits: Threading of property fetching and Render-proc
Re: AudioUnits: Threading of property fetching and Render-proc
- Subject: Re: AudioUnits: Threading of property fetching and Render-proc
- From: Ian Kemmish <email@hidden>
- Date: Fri, 10 Jul 2009 20:54:30 +0100
On 10 Jul 2009, at 20:04, Heinrich Fink <email@hidden>:
I stumbled across CAThreadSafeList.h that uses
CAAtomicStack.h in the Core Audio C++ sdk. From what I could read out
of the code so far, it seems this implementation is lock-free as well,
thus safe to be used in my scenario.
However, I am not sure if this implementation is efficient in terms of
a realtime producer/consumer paradigm. Does anyone have had experience
with this implementation? Unfortunately there is very little
documentation on this in the SDK.
A quick glance suggests that these are broadly equivalent to
OSAtomicEnqueue() and OSAtomicDequeue(), documented on the atomic(3)
man page, and indeed uses the same compare and swap primitive. I'm
sure Bill can tell you about any differences.
Note that CAAtomicStack.h uses the Barrier versions of the compare and
swap primitives, which may or may not be overkill for your situation.
(The Barrier versions ensure that all pending memory operations are
complete when the compare and swap executes, allowing you to enforce
whatever ordering of loads and stores you need.) If it is overkill, I
guess you could use OSAtomicEnqueue() and OSAtomicDequeue() directly.
While I don't use these two particular routines, I have been using the
other routines on this man page to implement my "side-salad" memory
manager which runs in its own, non-realtime thread. (Yeah, I know,
but sadly it's necessary.....) I certainly haven't noticed any
performance issues. They're just cover routines for specific CPU
synchronisation instructions, as far as I can see.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
Ian Kemmish 18 Durham Close, Biggleswade, Beds
SG18 8HZ
email@hidden Tel: +44 1767 601361 Mob: +44 7952
854387
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
_______________________________________________
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