the main loop

sfora dim sfora.dim at gmail.com
Mon Sep 15 23:26:08 PDT 2008


On Tue, Sep 16, 2008 at 9:03 AM, Thiago Macieira <thiago at kde.org> wrote:
> If you use a dbus_connection_read_write and stay there forever, you'll
> handle incoming calls, but you still won't handle outgoing messages
> properly.
>
> If you only handle incoming (signals and method calls) with no outgoing or
> very little of it (say, only message replies), then a thread would do.
>
> Otherwise, even a thread would require the five functions I listed.

If I set up filter functions to look at incoming messages, and send
outgoing messages using dbus_connection_send() from separate threads
of my application, will this main loop work (in a dedicated thread of
its own):
while(dbus_connection_read_write_dispatch(connection, -1))
     //empty loop body
    ;

(i took this idea from the wonderful documentations inside dbus-connection.c) ?

Thank you!
Sfora
>
> --
>   Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
>     PGP/GPG: 0x6EF45358; fingerprint:
>     E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>


More information about the dbus mailing list