DBusConnection* from a QDbusConnection

Thiago Macieira thiago at kde.org
Thu Sep 30 06:29:12 PDT 2010


Em Quinta-feira 30 Setembro 2010, às 14:26:16, maxprofitisback escreveu:
> Thiago Macieira wrote:
> > It's not a pool. It's just one connection (one QDBusConnection, wrapping
> > one DBusConnection).
> 
> Ok, sorry I am not familiar with D-Bus vocabulary. I mean by "pool" of
> QDbusConnection::sessionBus something like that:
> http://gitorious.org/qtcontacts-tracker/qtcontacts-tracker/blobs/master/src
> /dbus/connectionmanager.cpp within QThreadStorage array.

This pool is no longer necessary with D-Bus 1.4.

> >> How can I avoid DBus threading issues between the pool of connection and
> >> 
> >>   the DBus-Glib client API ?
> > 
> > What threading issues are you talking about? Note that dbus-glib is not
> > considered thread-safe.
> 
> I get random crash in my dbus-glib client API when it tries to call a
> blocking method to my external component: dbus_watch_handle (0x0, 2).

I can't help you with this. Let's see if someone knows.

Otherwise, post a small, self-contained, compileable example of the issue.

> > If your application is constrained for resources (e.g., low-powered
> > device where opening many D-Bus connections is a non-negligible
> > penalty), the only advice I can give you is to skip one binding or the
> > other, and use a single one for all your D-Bus needs.
> 
> So, in my case, I should rewrite my dbus-glib client API with QtDBus
> bindings. But if the external component ("server") supposed to interact
> with this API is again exposing D-Bus interfaces with dbus-glib
> bindings, will I get some errors?

Or rewrite your QtDBus parts with dbus-glib. It's your choice.

You should be able to interact with the remote API with any binding.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Qt Developer Days 2010  -  Munich Oct 11-13  -  San Francisco Nov 1-3
For more information and to register: http://qt.nokia.com/qtdevdays2010
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100930/427c829c/attachment-0001.pgp>


More information about the dbus mailing list