Re: AU Threading Question
Re: AU Threading Question
- Subject: Re: AU Threading Question
- From: Stephen Blinkhorn <email@hidden>
- Date: Sun, 10 Apr 2011 22:05:56 -0600
On 8 Apr 2011, at 15:38, Brian Willoughby wrote:
Have you tried redesigning your code so that you avoid "placement
new" as well? I've never found a need to allocate *anything* in my
AU Render calls, so that makes me suspicious even of placement new.
The instrument in question is a drum synth that allows the user to
select 1 of 13 different 'models' for each of the 16 drum pads. It is
also 64 note polyphonic. So really each note can be assigned to any
pad/part which in turn may use any one of the available model
algorithms (which are all implemented as sub classes of a base 'synth'
class). The last time I thought about pre-allocating all those objects
and writing a memory manager to deal with them I decided to opt for
placement new instead!
Even though placement new uses pre-allocated memory (avoiding calls to
malloc) the synth objects still need to be constructed at run time. I
don't know how much a problem that may pose in a real time audio
context. It would be interesting to find out.
Stephen
AudioSpillage
I have found that sticking to plain C, even though the overall
object is C++, serves me well.
So the reason I asked the original question was to get a better
understanding of how threading works in an audiounit/host context
and to make sure that I'm not doing anything via the GUI that could
cause the Render thread to block.
Ah, I see your question. Perhaps you're not so concerned that
something in Render is causing the issue; rather that something in
the Cocoa view is causing a problem. Well, if you're running in a
standard, well-behaved AU host, then none of the code should be
called on the audio thread except for Render. But, if you're also
writing the AU hosting code, then there's easily a potential that
you're calling unsanctioned API on the audio rendering thread.
Brian Willoughby
Sound Consulting
_______________________________________________
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