Ok.
Well, I assumed it to be a (if not thread affinity is used) transparent handling of cores by the OS. So I just tried to find out, how the number of threads could be increased when doing a certain operation. (namely processing two
machines, where the second one depends on the input of the first one)
If done properly and not gaining overhead or whatsorver multi-thread issue, then doing A in thread 1 and B in thread 2 (instead of A and B in thread 1) should increase performance, just afaik.
Ok. Well I mean specifically the possible 2-threads-instead-of-1-thread improvement.
Because machines A and B are processed in series, since B depends on the output of A. If B (e.g. reverb) knew the output of A (synth), both machines could be processed in parallel.
At a block to be processed: Does the reverb know the output of the synth? No, it can’t. But it can guess it. Guessing (predicting) the silence is of use here, because machines often produce silence.
Prediction was true:
- Great, B is ready earlier and it was just as performance-decreasing as all other multi-threaded signal-chains.
Prediction was false:
- It ran on a free (not used by other threads) core? Then no CPU time was wasted.
- It ran on a used core? Then performance of the other operations decreased.
Conclusion: The overall performance can increase.
PS: I’ve just ran renoise and had a look at autosuspend using Synth1 and want to add some thoughts:
Silencepredict and autosuspend would be very different.
As you described, autosuspend stops (among other things) processing the chain (after a lot of checked silent blocks).
Silencepredict cannot replace autosuspend. It rather would per each audio block (!) try to parallelize something that would actually be serial.
The outcome would look like this:
no silencepredicting:
thread 1: 5 ms loud-plugin then 3 ms reverb => 8 ms
silencepredicting in unlucky case:
thread 1: 5 ms loud-plugin then 3 ms reverb => 8 ms
thread 2: 3 ms reverb (dismiss)
silencepredicting in lucky case:
thread 1: 5 ms silent-plugin
thread 2: 3 ms reverb (use) => 5 ms
As you can see, core usage would increase, time usage would decrease.
Also, for the unlucky case a rewind function would be neccessary.
clipping_effect->rewind()
{
// probably no code in here
return ok;
}
delay_effect->rewind()
{
// lotsa code
// ...
return ok;
// or
return cant_rewind;
}