Starting the kdbus discussions

Thiago Macieira thiago at kde.org
Fri Jan 17 13:59:42 PST 2014


On sexta-feira, 17 de janeiro de 2014 19:42:55, Simon McVittie wrote:
> This turns out to lead to a confusing architectural train-wreck, and
> still doesn't get callbacks called in the right main-context - they all
> turn up in whatever main context is "dispatching", and if you want them
> to go elsewhere you have to post events between threads.
> 
> I'm not sure how QtDBus (which wraps libdbus) deals with this: I think
> it might do it by asserting the policy "async callbacks always go off in
> the Qt main thread, which is where I dispatch the connection; you must
> run the Qt main-loop in your main thread", and in practice that's how
> people use Qt anyway, so it works out OK?

That's exactly it. But worse.

The thread that first created the connection becomes responsible for always 
handling the socket. So there's a big problem if some user thread gets started 
and accesses D-Bus, but never runs an event loop or if it exits. Then that D-
Bus connection will never receive incoming calls or signals because there's 
nothing to handle its socket.

The other problem that David described also exists: if one thread does a 
blocking call, then all threads must wait.

One of the things I really want to do for QtDBus when we start working on 
kdbus support is to add a worker thread. Our plans[1] say that:

1. Take ahartmetz’s marshaller/demarshaller and put on top of QtDBus & 
    libdbus-1
2. Moving the handling to a thread
3. Handling our own socket
  * Remember the specifics about sockets on Windows
4. Adding kdbus compatibility

[1] http://qt-project.org/groups/qt-contributors-summit-2013/wiki/QtDBus_CS

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20140117/46082f2e/attachment.pgp>


More information about the dbus mailing list