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 744010 - g_file_monitor_file on a GResourceFile results in polling
g_file_monitor_file on a GResourceFile results in polling
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-02-04 20:23 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2015-08-21 04:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jasper St. Pierre (not reading bugmail) 2015-02-04 20:23:24 UTC
For a variety of reasons, we ended up using g_file_monitor_file on a GResource file.

This results in starting a new thread every second to query if the file changed its etag (it didn't) and then shut down. This is surprisingly expensive on low-power ARM devices where we're locked in a mutex the entire time waiting for new info to come in.

We should have a special case in g_resource_file_monitor_file that supplies a dummy file monitor since we know the file can't ever change.

Additionally, there's no way to test if a file is a GResource or if it can change.
Comment 1 Matthias Clasen 2015-08-21 04:03:23 UTC
I've added a dummy file monitor to GResourceFile, and I've implemented the following filesystem attributes:

type: resource
readonly: true

That should let you identify resource files