There some threads about the same topic, http://www.rawmaterialsoftware.com/viewtopic.php?f=8&t=7214&hilit=multicore …
So we have a Graph like this:
[attachment=2]mc1.png[/attachment]
We have to find the global order how the processors can operate. A algorithm finds all possible paths from “out” to “in” and counts every processor along its path, and mark this number to the processor. Higher numbers will overwrite lower numbers.
Something like this is think is already implemented in AudioProcessorGraph.
So we have something like this:
[attachment=1]mc2.png[/attachment]
Of cause feedback loops are not permitted, for simplicity reasons, also for Plugin Delay Compensation, the algorithm has to add compensation processores which add latency.
Now we can make a list, which operation requires other operations.
And we can calculate how many of this requirements a operation has, and which followers one operation has.
[attachment=0]mc3.png[/attachment]
When ever a operation is done, it will decrease the “Required Counter” of the followers.
If the „Required Counter“ of a operator goes to 0, it will start (from a Thread-Pool) to do this operation (or adds them to a fifo list, if all threads
are used at the moment)
Example:
Operator IN is 0 so it will begin:
After IN is done, it decrease the counters of
B A and C.
B and A and C’s required Counter goes to zero, 3 new operations will begin, and so on.
If a “required Counter” goes to 0 and the operation is done it will automatically reset to its inital number
Yes, it will be problematic if we want to work with live audio-input, so we have to
-add 1 one buffer extra latency (like a UAD Card), that allows us to have enough time-slices for the threads between the Audio-Callbacks
or
-calculate all path with live-audio input directly in the audio-callback (but then we have no multicore support)
Feel free to comment!