Synchronous calls to the same mainloop

uwesmail2005-lkml at uwesmail2005-lkml at
Fri Nov 10 08:59:00 PST 2006

--- keith preston <keithpre at> schrieb:

> Ok, so a little discussion on what I've been trying to do.   I am
> trying to
> make an very abstract programming interface through dbus that can be
> served
> by multiple backends.  This generally works well except for one case.
>   If
> the backend in running in the same process (mainloop) as the front
> end.    I
> first tried solving this by making dbus asynchronous calls, but found
> that
> this added too much complexity.   I tried making separate mainloops,
> but the
> dbus-glib bindings make this difficult.  So now I've started to look
> to how
> dbus could be changed to handle this.  I came up with a few options
> 1.  Have a short circuit.   When sending a message, check to see if
> it is
> going to the same connection and if so immediately answer it.
> 2.  In the synchronous blocking code, check to see if the incoming
> messages
> are either the reply (already does), or the  original message.    If
> they
> are the original message then dispatch it (which should give you your
> reply)
I have tried to plan how to implement the 2nd option (because it's
universal). It's even in TODO (around line 100) (Or was last I checked)
But we must catch the release date. No time for frivolous changes.
So the subject of that mail says what has to be changed in protocol to
let this option really work.
> This is my first stab at dbus internals, but I have implemented the
> second
> option and the patch is included.   The patch isn't perfect.   It
> spits out
> a couple early warnings about passing null to
> dbus_message_has_sender() when
> dbus is just starting up and dbus_bus_get_unique_name returns null,
> but I
> think it is good for discussion.
> Keith Preston
> > _______________________________________________
> dbus mailing list
> dbus at

Telefonate ohne weitere Kosten vom PC zum PC:

More information about the dbus mailing list