ServiceOwnerChanged wakes up everybody?
Kimmo.Hamalainen at nokia.com
Kimmo.Hamalainen at nokia.com
Thu Jun 9 05:13:14 PDT 2005
> -----Original Message-----
> From: ext Anders Carlsson [mailto:andersca at imendio.com]
> Sent: 09 June, 2005 14:43
> To: Hamalainen Kimmo (Nokia-M/Helsinki)
> Cc: dbus at lists.freedesktop.org
> Subject: Re: ServiceOwnerChanged wakes up everybody?
>
>
> Kimmo.Hamalainen at nokia.com wrote:
>
> >Hi,
> >
> >We were monitoring processes' CPU usage in the coming Nokia 770
> >internet tablet that extensively uses D-BUS and we found that
> >every process on the bus is woken up when some process enters
> >or leaves the bus. So it seems that the ServiceOwnerChanged,
> >and ServiceDeleted signals are always delivered to everybody
> >even if they are not AddMatched for. Is this a bug or desirable
> >behaviour? I think 95% of the processes don't use this information.
> >
> >BR, Kimmo
> >
> >
> Hello Kimmo,
>
> are you sure this is not because of the GConf or Gnome-VFS
> d-bus ports,
> because they listen for those events (at least ServiceOwnerChanged)
> because they need to know when the daemons disappear. The problem is
> that it's not possible to only listen to ServiceOwnerChanged for just
> certain services.
I re-checked the measurement data, and really there wasn't programs that
do not use GnomeVFS. So, it's probably because of that. Well, reading
D-BUS code was educational :) [I wondered, among other things, whether the
wait-forever-for-more-memory strategy used in some parts of the code fits
well to embedded devices that may have e.g. ulimit to the process. It could
cause a deadlock...]
> I've whipped up a patch that adds a "detail" argument to
> messages. This
> argument can be used to match both signals and messages. For
> ServiceOwnerChanged, the message detail contains the name of the
> service, making it easy to match only the needed messages.
Thanks a lot :) This could solve the problem.
After reading some of the D-BUS code I noticed several places where alloca()
could be maybe used instead of strdup() and free(). That would probably require
maximum sizes for e.g. service names etc. but could speedup somewhat.
BR, Kimmo
>
> Havoc, John, what do you think about this patch?
>
> Anders
>
More information about the dbus
mailing list