Using multiple matches for d-bus signals

Soh Kam Yung sohkamyung at gmail.com
Thu Oct 30 02:24:26 PDT 2008


Havoc,

Thanks for the reply.

I am running d-bus in an embedded environment.

Will the d-bus daemon slow down significantly if there are a lot of
matches (added via dbus_bus_add_match())?

If yes, is there a limit (or rule-of-thumb) to follow before the
daemon starts to get bogged down processing signal matches?

I would like to find some kind of balance between letting the d-bus
daemon process all the matches (and potentially causing the whole
d-bus system to slow down) and putting some signal matching in my apps
instead (which may cause the apps to do more processing).

Regards,
Kam-Yung

On Fri, Oct 24, 2008 at 11:08 PM, Havoc Pennington <hp at pobox.com> wrote:
> Hi,
>
> On Fri, Oct 24, 2008 at 3:40 AM, Soh Kam Yung <sohkamyung at gmail.com> wrote:
>> dbus_bus_add_match (dbus_connection,
>>    "type='signal',"
>>    "interface='my.test.[interface-to-match]'", &error);
>
> This would get all signals from the interface, regardless of which
> process sends it; you could add sender= to also filter by sender.
>
>> dbus_bus_add_match (dbus_connection,
>>    "type='signal'", &error);
>>
>> And then go through the received messages, searching for the expected signal(s)?
>
> This will get all signals of any kind.
>
> Which you should do depends on the use case. On a typical linux
> desktop, getting all signals of any kind would be bad, since your app
> would wake up in lots of cases where it need not.
>
>> Or should I consider using a single app that will listen to all d-bus
>> signals, interpret and dispatch the signals to other apps via some
>> other method?
>>
>
> Unlikely; the bus daemon itself should be able to dispatch signals
> according to the match rules. That's the daemon's job.
>
> Basically you should figure out how to match only the signals you
> need, or not too many extras anyway.
>
> Havoc
>

-- 
Soh Kam Yung
my Google Reader Shared links:
(http://www.google.com/reader/shared/16851815156817689753)
my Google Reader Shared SFAS links:
(http://www.google.com/reader/shared/user/16851815156817689753/label/sfas)


More information about the dbus mailing list