<div dir="ltr">In my experience, mixing access to D-Bus with multiple threads is generally a "bad idea". My experiences have been with the reference library (libdbus) and when used correctly (without access from different threads) it has proven to be quite robust. I've written my own Lua binding to the reference library and adhered to an asynchronous design pattern with a main-loop and single threaded architecture. This isn't the first binding I've done but early on the non-deterministic nature of using libdbus from multiple threads became painfully obvious. I have absolutely no experience with GDBus so I can't comment on the robustness of it's multi-threaded implementation. In general, however, I try to avoid using multiple threads with some of these large libraries whether they're for communication or graphics. Generally, have one thread that utilize the API and marshall the requests/responses (from different threads) over a synchronized channel. This approach has always worked well for me and reduced the time I've spent scratching my head and wondering why I'm seeing an unexpected seg-fault or (apparent) out-of-order execution.<br>
<br>Good luck with your efforts to use D-Bus from multiple threads . . . but if you have the opportunity, you may want to reconsider your approach . . . and certainly a different library than the reference one if you're stuck having multiple threads access the API.<br>
<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 23, 2013 at 9:51 AM, Emmanuele Bassi <span dir="ltr"><<a href="mailto:ebassi@gmail.com" target="_blank">ebassi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi;<br>
<div class="im"><br>
On 23 July 2013 13:47, Simon McVittie <<a href="mailto:simon.mcvittie@collabora.co.uk">simon.mcvittie@collabora.co.uk</a>> wrote:<br>
<br>
>> As long as GDBus is not the official reference implementation for DBus being available on all major<br>
>> operating systems (including Windows and MacOSX), I feel forced to stick to libdbus<br>
><br>
> Please do not feel forced to stick to libdbus. Being the *reference*<br>
> implementation does not mean that it is the *best* implementation.<br>
<br>
</div>also, GDBus is available (and working) on Windows and MacOS.<br>
<br>
ciao,<br>
Emmanuele.<br>
<br>
--<br>
W: <a href="http://www.emmanuelebassi.name" target="_blank">http://www.emmanuelebassi.name</a><br>
B: <a href="http://blogs.gnome.org/ebassi/" target="_blank">http://blogs.gnome.org/ebassi/</a><br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
dbus mailing list<br>
<a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dbus" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dbus</a><br>
</div></div></blockquote></div><br></div>