Best practices for handling setStateInformation on background thread

I think using callAsync with a copy of the state and do the ‘real’ state loading on the message thread is the only acceptable solution, and it might mean a block or two would be processed with the old state, but that’s not a issue.

Just to add to this, you should spin at the top of your processBlock() when you’re in offline render mode if you choose this approach.

while (isNonRealtime() && myAtomicFlagWhileStateIsLoading.load())
    juce::Thread::sleep (1);
3 Likes