GNOME Bugzilla – Bug 726318
gio: Document that GSocket is not thread safe
Last modified: 2014-04-17 06:53:29 UTC
Patch attached.
Created attachment 271851 [details] [review] gio: Document that GSocket is not thread safe
No. Nothing in glib or gio is threadsafe unless it is explicitly documented as such. Add such information in random places will only confuse people about this fact.
(In reply to comment #2) > Nothing in glib or gio is threadsafe unless it is explicitly documented as > such. Add such information in random places will only confuse people about this > fact. I would argue that send()/recv() are atomic, so people might reasonably think that the low-level GSocket API is also atomic. I certainly did, but I seem to make mistakes like this with annoying frequency. Perhaps I could reword the docs addition to say ‘Like the rest of GLib, GSocket is not thread safe…’?
People seem to expect GSocket to be thread-safe more often than they do other classes (eg, bug 705027).
(In reply to comment #3) > Perhaps I could reword the docs addition to say ‘Like the rest of GLib, GSocket > is not thread safe…’? Matthias, what do you think?
Now, that is not entirely accurate either. _Some_ parts of GLib _are_ explicitly thread safe.
(In reply to comment #6) > Now, that is not entirely accurate either. _Some_ parts of GLib _are_ > explicitly thread safe. Fair point. Which approach would you like? What you suggest, or the existing patch?
Created attachment 274506 [details] [review] gio: Document that GSocket is not thread safe
this one is factually correct, so lets go with it
Attachment 274506 [details] pushed as 2b247e1 - gio: Document that GSocket is not thread safe