I have occasionally run into an issue where my data will be corrupted in a way that appears to be due non-locked multi-process writes.
For example, the file will result like this:
{"foo": false,"bar": 42,"baz":12345}az":12345}
This usually happens when it seems like two or more separate electron render processes are writing different values to the same location.
Is there an way to guarantee mutex locking or a different access/write pattern that I should follow? Right now almost all of my reads/writes are using Electron's remote object API, so theoretically they're using the same object instance to read/write.
Thanks!
[edit] I found a few places in our code where we weren't using the same instance object and therefore I'm assuming that was responsible for the existing lock protection not correctly working. I'll close the issue when I can verify resolution, but would like to leave this issue up in case anyone else stumbles upon this error googling problems.
I have occasionally run into an issue where my data will be corrupted in a way that appears to be due non-locked multi-process writes.
For example, the file will result like this:
{"foo": false,"bar": 42,"baz":12345}az":12345}
This usually happens when it seems like two or more separate electron render processes are writing different values to the same location.Is there an way to guarantee mutex locking or a different access/write pattern that I should follow? Right now almost all of my reads/writes are using Electron's remote object API, so theoretically they're using the same object instance to read/write.
Thanks!
[edit] I found a few places in our code where we weren't using the same instance object and therefore I'm assuming that was responsible for the existing lock protection not correctly working. I'll close the issue when I can verify resolution, but would like to leave this issue up in case anyone else stumbles upon this error googling problems.