Is IComponent::getState()/setState() thread-safe?

I think I understand the gist. Probably need to do something similar with getState and reading parameter (inputParameterChanges) though

That being said, why is allocating/freeing memory better than using a very short live lock? (playing the devil’s advocate here… but you can implement very efficient locks… and in this case the lock is being held ONLY during the copy of the memory)

Ex:

tresult process (ProcessData& data)
{
   MyParams stateParams;
   withLock {
     stateParams = processParams;
   }
}

tresult setState (IBStream* stream)
{
   MyParams stateParams;
   // read state from stream into stateParams !
   withLock {
     processParams = stateParams;
   }
}

Thanks

Yan