Hi my plugin is using a juce::PropertiesFile
to store some settings (xml). If there are multiple instances it seems that if one instance is storing a value and the other instance is reading it, its value is not updated.
Am I missing here something?
Thanks!
Because this class uses an internal cache. Solution:
Use a SharedResourcePointer to share the same Properties for all plugin Instances.
PS:
@jules, a Multi process aware properties class would be a great addition.
Yep, a multi-process one would be pretty cool. Harder than it sounds to make one work reliably though!
Thanks, this works across address spaces? I.e. in separate applications?
No, but multiple instances of a plugin in one host usually share the same process space
Thanks, so it works “somehow”. Thats exactly what I am always looking for…
You will have to be careful of this though. More and more these days plugins will be in their own process so will not share memory and things like SharedResourcePointer won’t work.
BitWig and AUv3 are two examples that I know of but it’s becoming more common.
The only way something could work, is over the file-system as abstraction layer.
Any kind of interprocess interaction, may not work, because the processes might be isolated from each other.
One implementation idea i had, the first accessor puts a write-Lock on the settings file.
Any other accessors only write delta-files next to the main-file.
Any changed property-item creates a separate delta-file.
The process, which has the write lock, integrates the changes from the deltas into the main file.
When a property is accessed, the accessor looks first if there are any delta-changes to one of the properties.