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 688058 - Make (some of) GnomeBG thread-safe
Make (some of) GnomeBG thread-safe
Status: RESOLVED OBSOLETE
Product: gnome-desktop
Classification: Core
Component: Background
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks: 682427
 
 
Reported: 2012-11-10 20:19 UTC by Giovanni Campagna
Modified: 2013-02-19 20:00 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
GnomeBG: add a thread safe variant of gnome_bg_draw() (4.57 KB, patch)
2012-11-10 20:19 UTC, Giovanni Campagna
reviewed Details | Review
Actually make GnomeBG thread safe (2.37 KB, patch)
2012-11-10 20:20 UTC, Giovanni Campagna
none Details | Review

Description Giovanni Campagna 2012-11-10 20:19:24 UTC
The plan (bug 682427) is to move background rendering from gnome-settings-daemon to mutter. As gnome-shell already has issues to keep the frame-rate, I don't want to block the main loop doing the tons of sync IO GnomeBG needs.
Instead, given that GnomeBG is fully software rendered, I want to render backgrounds in a worker thread, and the following patches allow me to do that.

I didn't touch the cairo or X11 bits, as those are usually very tied to the main thread.
Comment 1 Giovanni Campagna 2012-11-10 20:19:56 UTC
Created attachment 228651 [details] [review]
GnomeBG: add a thread safe variant of gnome_bg_draw()

The only thread unsafe part of that function is the one accessing
monitor geometry from GdkScreen, so if that's factored out one can
do background rendering in a worker thread.
Comment 2 Giovanni Campagna 2012-11-10 20:20:06 UTC
Created attachment 228652 [details] [review]
Actually make GnomeBG thread safe

GLib data structures are only thread safe if two threads never access
them at the same time. As creating a new GnomeBG means dropping the cache on
the floor and might be undesirable, serialize drawing through a mutex.
Comment 3 Matthias Clasen 2012-12-10 20:54:19 UTC
Review of attachment 228651 [details] [review]:

Makes sense to me
Comment 4 Matthias Clasen 2012-12-10 20:54:28 UTC
Review of attachment 228651 [details] [review]:

Makes sense to me
Comment 5 Giovanni Campagna 2012-12-10 22:27:33 UTC
So this is an accepted-commit_now?
Comment 6 Matthias Clasen 2012-12-10 23:46:56 UTC
Still hoping for Ray to review the background work...
Comment 7 Ray Strode [halfline] 2013-02-19 19:07:26 UTC
Giovanni, i'm going to close this now, since it's not as relevant anymore. reopen if you have any objections and still want to see this go in.
Comment 8 Giovanni Campagna 2013-02-19 20:00:01 UTC
I agree with you, this is not needed. Thank you for taking care of it.