Multi-Process aware PropertiesFile urgently needed!

More DAWs will begin isolate plugins in separated processes, and the current implementation of PropertiesFile does not consider this.

When the plugin becomes it’s own process, wouldn’t ApplicationProperties be the right choice?
If that fits your use case, the ApplicationProperties accepts an InterprocessLock.

If the wrapper handles this behind the scenes though, is there a way to know, if we are being loaded in a separate process?

EDIT: I just see that PropertiesFile uses the PropertiesFile::Options as well, so you can use PropertiesFile with an InterprocessLock as well
PropertiesFile::Options

A lock alone doesn’t solve the problem, because the cached properties must be updated when another process changes the file

Since it is a ChangeBroadcaster I was under the impression it would monitor the file, but now I am unsure, would need to check.

These are my two requirements for the class PropertyFile

  1. The lock function should automatically be included in the class without the need using an extra interprocess lock, through the file handle of the Prorperty-File.

  2. Before any read operation, PropertyFile file has to check (while holding the lock), if an updated version of the file exists, and update its internal data-structure)

3 Likes

Hi

Did you find an elegant way of doing this?
Or is this planned to be natively handled in JUCE in the near future?

It is fairly trivial.
I even created a version using a ValueTree instead of the flat NamedValueSet for my PluginGuiMagic:

Here the code for inspiration:

1 Like

Thanks!
Aren’t we supposed to enter() the lock to make it work?

Oh great, thanks. I got way too much used to the ScopedLocks.
I‘ll get that changed.