Hi,
I'd like to optimize my processBlock function using some parallel processing in order to improve performances on arm multi-core target.
My software generates two sounds with some effects that are mixed together. The current processing chain is the following:
MIDI Note processing => Sound 1 generation => Sound 2 generation => Sound 1 & 2 mix
I'd like to have something like:
=> Sound 1 Generation =>
MIDI Note processing -| |= Sound 1 & 2 mix
=> Sound 2 Generation =>
I tried to put the Sound 2 Generation into a thread which run() method looks like this
while (threadShouldExit()==false)
{
workInProgress = true;
// sound 2 generation
workInProgress = false;
wait(-1);
}
In the ProcessBlock function the thread is called like this :
//MIDI Note processing
sound_2_thread->notify() // start the Sound 2 generation on the thread
// Sound 1 generation
while (sound_2_thread->workInProgress=true); // wait for Sound 2 generation to finish if necessary
// Sound 1 & 2 mix
Well, this works on OSX in debug mode but not at all in release mode or on ARM target. The ProgressBlock got stuck into the
while (sound_2_thread->workInProgress=true);
I know the ProcessBlock function is very sensitive so what would be a good way to achieve parallel processing in the ProcessBlock ?
Thanks for your help !
