If I have two processes accessing a given registry key (e.g. HKLM
), should I wrap the the logic in a mutex?
The registry will make sure the actions are atomic, so you don't have to synchronize it yourself.
However, if you have multiple processes / threads accessing the registry at the same time, it doesn't make any guarantees about which happens first. Only that you won't get garbled data.
Edit: Further reading, see The inability to lock someone out of the registry is a feature, not a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With