Re: Skype and DBus: should my client library act as a server?

Simon McVittie <simon.mcvittie-ZGY8ohtN/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Collabora Ltd.
Message-ID <[email protected]>
On 18/03/15 20:00, Julien JPK wrote:
>  - Start sending my requests from another thread.

Threads! You had a problem, you solved it with threads, and now you have
two problems working in parallel :-)

GDBus has a much better design for threaded use; I strongly recommend it
(and fixed some of its previous threading bugs myself). libdbus is in
theory designed to be thread-safe, but we're not quite sure whether it
actually is; I suspect the answer is "it depends how you use it".

A lot of the pain you have to go through when using libdbus is because
it bends over backwards to avoid depending on any particular event-loop
implementation (GLib, Qt, libevent, etc.) - GDBus can be much simpler
because its asynchronous API is "use the GMainContext abstraction that
GLib already has".

> However, it seemed to me like GLib was overkill for what I
> was trying to achieve at the moment (it is, after all, a huge library...).

GLib is a somewhat large library because "make C non-horrible for
application development" is a significant task, and "make C non-horrible
for application development, in a portable way" doubly so.

libdbus suffers greatly from having to have its own
a-bit-like-GLib-but-not-as-good "make C non-horrible" layer. If you are
not under constraints similar to dbus-daemon, I recommend avoiding libdbus.

-- 
Simon McVittie
Collabora Ltd. <http://www.collabora.com/>

_______________________________________________
dbus mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.