Why d-bus when many IPC mechanisms are available?

LRN lrn1986 at gmail.com
Thu Aug 23 08:27:33 PDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 23.08.2012 17:01, pramoda.subraya at wipro.com wrote:
> Hi,
> 
> Please help me to understand the d-bus by clarifying
[1] answers a lot of your questions. You're not doing your research well.

> 1.    Why D-Bus when many IPC mechanisms are available?
[2] specifically answers how D-Bus is different from other forms of
communication. Namely - unix sockets and tcp sockets.

> 2.    On what IPC mechanisms, d-bus is implemented?
[3] specifically lists official transports.

> 3.    Whats the difference bw/ d-bus and Glib or Gio ?
D-Bus is a process communication framework. GLib is a generic
low-level utility library (among other things it implements a main
loop and a per-process message bus; these can be integrated with
D-Bus, obviously). GIO is part of GLib focusing on Input/Output (in
particular, it implements channels - abstractions over various I/O
mechanisms, which can be integrated into GLib message loop).

> 4.    Advantages of D-bus  over other std IPC mechanisms
> (PIPE/Shared memory etc)
It's a spec, and a framework, and a library. "Spec" means that you are
not forced to use libdbus, and are free to write your own library (as
long as it follows the specification). Though most likely you'd be
better off using one of the wrappers for libdbus.
"Framework" means that it extends the OS with a messaging service for
applications (so, for example, D-Bus can notify applications about new
devices), and that any D-Bus-able application becomes part of the system.

It's better than pipes, since when using pipes you have to write IPC
protocol from scratch. You just can't compare D-Bus to pipes or
sockets. Same goes for shared memory (though, i guess, when you
actually _need_ to share big lumps of memory, using actual shared
memory primitives yields best results, although you'll have to write
of find a portable shared memory utility library; you can negotiate
memory sharing via D-Bus).

Use of a single specification means that any application can
communicate with any application in not-entirely-trivial ways, even
though they were not designed specifically for inter-communication
with one another.
A common implementation means that you don't have to re-implement
anything, and communicating with other applications involves minimal
amount of your own custom code.

Best equivalent i can come up with is Window Messages that are part of
W32 windowing system. D-Bus is kind of like that, but younger, with
much flexible design, portable and free.

> Please do not print this email unless it is absolutely necessary.
> 
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of
> the addressee(s) and may contain proprietary, confidential or
> privileged information. If you are not the intended recipient, you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately and destroy all copies of this
> message and any attachments.
By sending your message to a _public mailing list_ you automatically
agreed that your message would be delivered to an _unspecified number
of unidentified third parties_, will be put into a _public mailing
list archive_, and can thus be searched, referenced, replied to (by
anyone) and, possibly, quoted.
At this point of time it is nether feasible, nor legally possible to
find and destroy all copies of your message.

[1] http://en.wikipedia.org/wiki/D-Bus
[2] http://dbus.freedesktop.org/doc/dbus-faq.html
[3] http://dbus.freedesktop.org/doc/dbus-specification.html

P.S. I would welcome all and any corrections from actual D-Bus developers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQNkvkAAoJEOs4Jb6SI2CwkQcIALZKpD0jiaGRuwa/3mlOI1wI
M+FjwwteEOaKpU1+zdv7/e5AusvGy6FBZovUNHSkUFPJr9nuqL6O/OKWdmwUW4Wj
QLl87e0iXZ9sHC5Q8TaITXpXtv8oHa0r3w/STyaScJy9BHbreHB2Z2bZlbMO8UG2
LXrJuPrmIaL4qlNOElpxLlz7TIV6sWry0fQUyYDoVULsClqpCYdj3EPHnxLBd98q
Gob96z1+MbbNfNcgx3f66bnB9BKB+bxITmNoKJkcYD3O/wW3FmFAHLu70F1t2hHI
mGB/5IZhkuGwoDz1/SrbFsqj7jk+2Wvh9idgV/ZILP5PobwxnC4CSaMBmUBvSKs=
=NrsQ
-----END PGP SIGNATURE-----


More information about the dbus mailing list