dbus linked with libglib by default

Daniel P. Berrange dan at berrange.com
Thu Sep 21 07:15:00 PDT 2006

On Thu, Sep 21, 2006 at 03:23:20PM +0200, frederic heem wrote:
> Hi,
> Libdbus contains many functions and structures that were taken from glib, only 
> the prefix was changed, for example:
> dbus_new/delete, dbus_string_*,  dbus list_*, dbus_mutex_*, dbus_loop_*, 
> dbus_spwan etc ...

It wasn't merely copied - take a look at the source for dbus_string_*
versus g_string_*  - the code is totally different - its even distributed
under different license.

> I guess this was to avoid linking to glib, hence to make the qt guy accept 
> dbus. 

From what I understand, this wasn't the only (or even primary) reason. The
DBus version functions have very different behaviour on out-of-memory
conditions. Glib will basically abort the process when hitting OOM, while
DBus was designed to propage OOM to the caller allowing it to be retried,
or similarly handled in a less terminal fashion than abort. This is quite 
an important characteristic for a core system library/daemon.

> Things has changed, the upcoming Qt 4.2 is linked with glib. Actually, this is 
> a good news for dbus. By using glib directly, the codesize can be shrink 
> roughly by half, startup time too can be reduce too since less code needs to 
> be loaded in ram. It would be event better for embedded system where even 
> 100kb is important.

QT & GLib aren't the only users of DBus - there are plenty of other language
bindings for dbus out there. Robust error handling on OOM is important in
embedded systems too & not all embeddded systems using DBus neccessarily
have GLib present.

> Maintenance can be reduce too, all bugs solved in glib are directly solves in 
> dbus, no need to periodically merge.
> Apart from the initial work to change all dbus function to their glib 
> counterpart, there isn't any drawback at all. 

No drawbacks...aside from the completely different calling & error
handling semantics.

|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060921/402b5a91/attachment.pgp

More information about the dbus mailing list