In Elektra we have the concept of conflicts. To be able to write a config (or one key from the config) you have to first get the latest version of the config. This way, if you try to change a config which was modified without your knowledge, you get back a conflict.
Since this conflict concept does not really exist in GSettings, we simply write the last version of a key. When multiple processes write to the same key, basically the last process “wins”.
On a high level both are key-value databases, but we don’t want to reimplement dconf.
Elektra aims to be a general purpose configuration framework, unifying access to configuration files. We are also working on KDE (KConfig) support and already support many other configuration formats (TOML, JSON, XML, CSV, …) as well as bindings for many languages (C, C++, Python, Lua, Ruby, … ). Elektra is extensible via a plugin interface and allows users to specify and validate configuration. Elektra’s GSettings backend is a comparably small component.
Afaik dconf is very specialized to suit the needs of GNOME. As such, dconf might be faster than Elektra, but it does not solve the other big-picture problems. The performance is something we are trying to evaluate, as Elektra also utilizes an mmap
based cache. More important to us though, is that we simplify and unify access to configuration for developers, providing a better experience.
Actually we are not directly using it. We have a working prototype GSettingsBackend
based on Elektra and install it to the GIO module dir. It replaces the dconf module, so everything uses Elektra and not dconf. Whatever threading is going on is done by GNOME, GIO, or whatever manages the GSettings backend instances.
This is how we noticed that data, which should be private to a GSettings backend instance, is modified by another thread leading to corrupted data and segmentation faults. When we wrap access to the data with a GMutex
the problems are gone. The mutex would not be needed if one instance was not accessed by multiple threads at the same time.