From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [RFC PATCH 8/8] dbus: Implement org.freedesktop.DBus.ObjectManager
Date: Fri, 29 Jan 2016 11:44:50 -0600 [thread overview]
Message-ID: <56ABA512.8000801@gmail.com> (raw)
In-Reply-To: <CAOq732+Y8bTARJvYzhcfgXzqaa42xmVLj6quG5Uo1j-ciyCJ7A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2339 bytes --]
Hi Andrew,
On 01/29/2016 10:47 AM, Andrzej Zaborowski wrote:
> Hi Denis,
>
> On 29 January 2016 at 04:35, Denis Kenzior <denkenz@gmail.com> wrote:
>> I think the way we want to do this is to model things something along these
>> lines:
>>
>> register_interface -> registers global interface object, e.g.
>> l_dbus_interface
>> add_interface -> adds an instance of the interface to the tree, e.g.
>> interface_instance
>>
>> Each dbus bus instance would have a 1:1 relationship to the object tree.
>
> So far that is what we have in this patch series, right?
Sort of. We have the interfaces hanging off the tree object. I think
they might belong on a global data structure and shared between multiple
object trees.
>> We have to be pretty careful here. What if the object is removed while
>> we're generating the reply? Do we need to rethink having async getters?
>
> That's a good point, and I also haven't yet added any code to forget
> about the running getters and setters calls when a dbus connection is
> shut down. But I don't think we can avoid async getters and setters.
> In this case it should be sufficient to check that the path and the
> instance are still present just before making the call.
Setters are not the problem. Those can be async.
I'm now not convinced that getters can be async given the complexity of
the resulting code. See what you can come up with, but we might need to
think carefully about this some more.
>>
>>
>> Yikes. Is there a way to be a bit smarter here and walk the tree instead of
>> using the very expensive hashmap_foreach?
>
> We can do either, but it doesn't seem like l_hashmap_foreach is that
> expensive. It is going to make some useless iterations while there
> are empty buckets, later it's just as fast as a list. The tree on the
> other hand has more nodes we're not interested in.
Not sure I agree. If we have an object manager on a subpath, then
there's no point walking the entire hashmap. Walking through the
children of the node would be faster in this case and eliminates some
strcmps.
For the root ObjectManager, this call is also pointless since we know
all the objects will be included. Anyway, I think we have more
important things to consider, but keep this one in mind.
Regards,
-Denis
next prev parent reply other threads:[~2016-01-29 17:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-23 2:59 [RFC PATCH 1/8] dbus: setters and getters API for properties Andrew Zaborowski
2016-01-23 2:59 ` [RFC PATCH 2/8] dbus: Separate interface registration from instantiation Andrew Zaborowski
2016-01-26 21:13 ` Denis Kenzior
2016-01-26 23:40 ` Andrzej Zaborowski
2016-01-27 0:16 ` Denis Kenzior
2016-01-23 2:59 ` [RFC PATCH 3/8] dbus: Don't show Introspectable on intermediate nodes Andrew Zaborowski
2016-01-25 15:48 ` Denis Kenzior
2016-01-23 2:59 ` [RFC PATCH 4/8] dbus: Message builder function to copy from an iter Andrew Zaborowski
2016-01-23 2:59 ` [RFC PATCH 5/8] dbus: Private function to retrieve the tree for a connection Andrew Zaborowski
2016-01-23 2:59 ` [RFC PATCH 6/8] dbus: Handle legacy GetProperties and SetProperty automatically Andrew Zaborowski
2016-01-29 0:16 ` Denis Kenzior
2016-01-23 2:59 ` [RFC PATCH 7/8] dbus: Implement org.freedesktop.DBus.Properties Andrew Zaborowski
2016-01-23 2:59 ` [RFC PATCH 8/8] dbus: Implement org.freedesktop.DBus.ObjectManager Andrew Zaborowski
2016-01-29 3:35 ` Denis Kenzior
2016-01-29 16:47 ` Andrzej Zaborowski
2016-01-29 17:44 ` Denis Kenzior [this message]
2016-01-29 18:53 ` Andrzej Zaborowski
2016-01-29 19:19 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56ABA512.8000801@gmail.com \
--to=denkenz@gmail.com \
--cc=ell@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.