call for advice (is dbus ok for me ?)

Avery Pennarun apenwarr at gmail.com
Thu Aug 21 10:10:28 PDT 2008


On Thu, Aug 21, 2008 at 12:54 PM, sfora dim <sfora.dim at gmail.com> wrote:
> It's a multithreaded daemon written in C that needs to export API for
> numerous clients, each of which may be written in a different
> language.
>
> I need the clients to be able to call the daemon's exported functions,
> to be able to pass it all sorts of data arguments, and most
> importantly, I need them to be able to register a callback at the
> daemon. Once the daemon finishes the task, it should call the given
> callback.

dbus is designed for exactly such situations.

> I know there are many language bindings to dbus, and that's really
> great for the clients, but my daemon is pure C, and it is
> multithreaded. is there a preferred binding I should use for the C
> server ?

dbus itself is written in C.  You might want to use dbus-glib, which
is in C but tries to be more "object-oriented", or else just use
libdbus directly.  Despite repeated claims in the documentation,
libdbus is actually pretty straightforward if you're familiar with C.
And it's threadsafe.

> Is d-bus mature and capable for supporting such a daemon (I really
> need production level of quality) ?

It's very much production quality and is used in all sorts of
production systems, including any Linux machine running Gnome.

Have fun,

Avery


More information about the dbus mailing list