DBus Un-activation
Colin Walters
walters at verbum.org
Mon Sep 8 12:12:41 PDT 2008
On Mon, Sep 8, 2008 at 3:05 PM, David Boucher <boudav at gmail.com> wrote:
> Hi,
>
> In my application, the DBus activation of the server works well :-)
>
> When I start a client, if the server is not running, DBus starts it alone.
>
> Now, I want that when all my clients are closed, the server to stop too.
I believe the reason this is hard is because if your server exits, it
will create a race condition where clients trying to talk to it just
before it chooses to exit can see their messages dropped.
If we wanted to solve this I could imagine some sort of protocol where
a service can say to the bus "I am going to exit due to inactivity",
and the bus can say "but you have a message pending" (and the service
continues to run), or say "ok". Maybe. I'm handwaving a bit =)
Anyways for now I would concentrate on making your service lightweight
if you can. The refcount approach might be "good enough" for now too.
More information about the dbus
mailing list