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: William Stewart <email@hidden>
- Date: Thu, 2 Jul 2009 20:31:23 -0700
On Jul 1, 2009, at 10:25 AM, Heinrich Fink wrote:
Hi,
I have a threading related question regarding the render process and
fetching properties from an audio unit.
My AudioUnit is implemented using the SDK as a subclass of
AUEffectBase. Similar to the SonogramView-Example a buffer gets
filled in AUKernel::Process with some information that has been
extracted from the audio samples (e.g. ZeroCrossingRate). The data
of this buffer can be queried from a client using
AudioUnitGetProperty from some other thread (e.g. a dedicated Render
thread).
Now, the following questions came up that I wasn't able to answer
with documentation or previous posting yet:
Is it safe to access the same data in AUEffectBase::GetProperty and
AUEffectBase::Render without mutual exclusion (as in
SonogramViewDemo), i.e. using a non-thread-safe data structure.
risky and in a pure world, no.
Which thread is actually executing AUEffectBase::GetProperty?
Is it simply the caller thread of AudioUnitGetProperty or some other
dispatcher thread of the component manager?
any thread that calls AudioUnitGetProperty
If there is no way to mutually exclude the render process from
fetching properties could this be achieved by (ab)using parameters?
you can transfer data to and from your list by looking at some kind of
lock free list of some description - then your "get" calls would only
get data that is safe and not be in a problem if the render call is
modifying the list in some way
Thanks in advance for any comments/pointers on this topic,
- Heinrich
_______________________________________________
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
_______________________________________________
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