Re: How long do render callbacks have to execute?
Re: How long do render callbacks have to execute?
- Subject: Re: How long do render callbacks have to execute?
- From: philippe wicker <email@hidden>
- Date: Fri, 19 Aug 2011 16:00:12 +0200
On 19 Aug 2011, at 07:53, tahome izwah wrote:
> 2011/8/13 Brian Willoughby <email@hidden>:
>>
>> On Aug 12, 2011, at 15:39, Jonathan wrote:
>>>
>>> Okay, that makes sense, but are the callbacks called in parallel? In other
>>> words, is only one callback firing at a time? In the example with two
>>> inputs into the mixer, does it fire one right after another even though from
>>> a graph perspective they are peers?
>>
>> In general, a processor cannot carry out any operations in parallel.
There is however one situation where a single core can execute 2 threads simultaneously, in "parallel" in a way. This is when hyper-threading is enabled. For those of you who may not know what is "hyper-threading" the basic idea behind it is to design the silicon in such a way that a second thread of instruction can be processed by filling the "holes" in the pipeline left by the 1st thread of instruction.
At some point any instruction you can write needs the result of some other preceding instructions (a "good" example of this is an IIR filter). Because of this dependency the pipeline is not fully used, the hardware has to insert "stall" cycles - some sort of "NOP" cycles - needed for a result N to be actually available as input of instruction N+1. These "NOP" cycles can be filled with instructions from the 2nd thread.
I don't know if Apple uses or not this feature - I remember having read some time ago that the gains in performance were not always as good as expected - but if it is enabled the OS may choose to assign 2 threads to the same core.
Anyway, it does not mean that callbacks are executed in parallel - in the sense of running at the same time in 2 different threads. For what I'v seen so far, the callbacks to a given AU instance always originate from the same thread.
>
> Not true. That is exactly what SIMD instructions do which are built
> into all modern CPUs.
>
> --th
> _______________________________________________
> 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