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 700855 - [PATCH] gdbus-peer: Drop some usage of g_thread_yield()
[PATCH] gdbus-peer: Drop some usage of g_thread_yield()
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-05-22 18:01 UTC by Colin Walters
Modified: 2013-05-23 14:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-gdbus-peer-Drop-some-usage-of-g_thread_yield.patch (6.02 KB, patch)
2013-05-22 18:03 UTC, Colin Walters
accepted-commit_now Details | Review

Description Colin Walters 2013-05-22 18:01:55 UTC
It's a recipe for race conditions and error; on some hardware
architectures one thread isn't guaranteed to see the results
of writes from another thread without a cache flush.
---
 gio/tests/gdbus-peer.c |   66 +++++++++++++++++++++++++++++++----------------
 1 files changed, 43 insertions(+), 23 deletions(-)
Comment 1 Colin Walters 2013-05-22 18:03:10 UTC
Created attachment 245079 [details] [review]
0001-gdbus-peer-Drop-some-usage-of-g_thread_yield.patch
Comment 2 Dan Winship 2013-05-23 14:07:36 UTC
Comment on attachment 245079 [details] [review]
0001-gdbus-peer-Drop-some-usage-of-g_thread_yield.patch

Patch looks good.


This pattern shows up a lot (or, as in this case, fails to show up where it should have). It would be neat have something like:

  GThread *g_thread_new_wait (const gchar *, GThreadFunc, gpointer);
  void     g_thread_signal_ready (void);

Where g_thread_new_wait() calls g_thread_new() and then blocks until the new thread calls g_thread_signal_ready().