After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616314 - Make GSettings (partially) threadsafe
Make GSettings (partially) threadsafe
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gsettings
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on:
Blocks: 616265
 
 
Reported: 2010-04-20 16:49 UTC by Sebastian Dröge (slomo)
Modified: 2010-05-18 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2010-04-20 16:49:37 UTC
Hi,
for GStreamer we would need GSettings to be at least partially threadsafe. According the Ryan it currently isn't even possible to read settings from different threads. With GConf this works.

Additional to reading settings from different threads it would be nice if watches for setting changes could use a non-default main context but that's less important for now.
Comment 1 Allison Karlitskaya (desrt) 2010-04-25 18:09:52 UTC
This will definitely be supported.
Comment 2 Allison Karlitskaya (desrt) 2010-05-18 13:47:16 UTC
yesterday i checked in a reasonably complete story for threading features:

  1) accessing a GSettings instance (or multiple separate instances) from different threads is safe
  2) creating/destroying GSettings instances in multiple threads at the same time is safe
  3) the 'thread default context' at the time of g_settings_new() is where the signals go

this is all GSettings itself.  the backends may or may not be threadsafe.  "memory" backend is not threadsafe right now for example.  i'm aiming for dconf to be.

i think there is one operation left that is thread-unsafe: interacting with a GSettings in one thread while calling g_settings_delay() in another.  that's a pretty unusual case, though.

if you run into bugs/issues with the new (claimed) thread-safety, please file some bugs to let me know on a case-by-case basis.