[maemo-developers] dbus overhead of unnecessary signals
From: Austin Che maemo at austinche.nameDate: Mon Dec 10 19:19:07 EET 2007
- Previous message: N810 available in nokia shop Germany - but discount code fails
- Next message: dbus overhead of unnecessary signals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm new to the dbus world and was wondering what the overhead/cost
is of many dbus messages. In particular, as an abstract example,
suppose I have an event daemon process that could possibly know
about n different events and send those out via dbus as n
signals. For any particular signal, if some other program is out
there listening for the signal, then presumably whatever the dbus
overhead is, it's worth it as it's doing what you want it to do.
But the real question I have is, what if no one is listening to
that signal?
Perhaps programs out there are only listening for half of those n
signals. For the ignored signals, there is presumably some work
for the daemon to listen/process that event, send it out via dbus,
the dbus bus daemon receiving the signal and deciding that no one
cares about it and dropping it. All of this, in theory, is
unnecessary work as no one cares about the message.
As one scales the number of such signals and their frequency, my
intuition is that it would not be a low cost on an internet tablet
as both the event daemon and dbus bus daemon will be constantly
waking up and doing unnecessary work. In particular, the work
needed to listen/process an event is potentially unbounded.
If it is indeed unscalable or a large cost, then an alternative
programming model is for the event daemon to not do anything until
another program sends it a signal that it's interested in a
particular event. Then the server starts sending out the signals
for that event, until all programs who have expressed interest
disappear or indicate they've lost interest. Clearly, this is
programmable in the dbus framework and leads to no unnecessary
work being done. However, it also seems redundant for programs to
do this as this seems like what the bus daemon is doing.
Sending signals to unknown targets seems to me to be a common
paradigm in the dbus world but I have not seen a dbus program that
avoids sending signals that no one cares about. Why is this? Is
there an efficient way to avoid unnecessary dbus signals that
doesn't require writing lots of code? It seems ideal if the event
daemon could just ask the bus daemon or be notified by it when
someone is listening for a particular signal.
For the maemo developer, this choice makes it necessary to decide
whether some program out there likely wants to know about a
particular signal and thus only emit those signals. However, it
seems to be much more in the spirit of dbus signals to just emit
all the signals you could possibly think of emitting and let the
receivers decide what they want to listen to.
- Previous message: N810 available in nokia shop Germany - but discount code fails
- Next message: dbus overhead of unnecessary signals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
