From: Werner Almesberger <werner@almesberger.net>
To: Rajesh Venkatasubramanian <vrajesh@umich.edu>
Cc: linux-kernel@vger.kernel.org, kernel@kolivas.org
Subject: Re: [RFC] Generalized prio_tree, revisited
Date: Thu, 16 Dec 2004 10:57:47 -0300 [thread overview]
Message-ID: <20041216105747.T1229@almesberger.net> (raw)
In-Reply-To: <41C16D8D.7020702@umich.edu>; from vrajesh@umich.edu on Thu, Dec 16, 2004 at 06:12:13AM -0500
Rajesh Venkatasubramanian wrote:
> The "raw" prio_tree can only handle unique intervals, i.e., we cannot
> insert two intervals with the same indices.
Yes, I admit that I found it convenient (laziness is a survival
trait :-) to preserve this property of the underlying code.
In fact, I'm not so sure if we should really offer alternatives at
that level, since it seems that adding a conflict resolution layer
on top of prio_tree (or including it in the user) is about as much
work as including one inside, and the former could be tailored to
the specific needs of the user, e.g.
- new entry is rejected
- new entry replaces old entry
- entries are somehow merged (reference count, add partial
content, etc.)
- entries neutralize each other
- both entries are kept, in a list (like VMA and the ABISS
elevator do)
- both entries are kept, ordered by some other key
- action depends on context
and so on. So it seems to me that we're just at the level of
abstraction that gives us the most narrow interface and that
doesn't hide any information we need to implement the other
cases. And it's just the "engine" that would be used in all
cases anyway.
Besides, handling of non-unique entries shouldn't such a big
deal that the user whould be seriously inconvenienced by having
to do it. E.g. in the case of red-black trees, we also expect
the user to do a lot for us.
> Maybe in your case you don't have to worry about storing multiple
> identical intervals.
I just build a list that's usually read in FIFO order. In
my case, any kind of overlap needs special handling, so
non-unique entries aren't much extra work.
If I was really ambitious, I could try to combine non-unique
requests if they all are writes (but then, having a lot of
these is probably an indication of problems elsewhere).
Thanks,
- Werner
--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina werner@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
next prev parent reply other threads:[~2004-12-16 14:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-16 8:31 [RFC] Generalized prio_tree, revisited Werner Almesberger
2004-12-16 9:02 ` Con Kolivas
2004-12-16 9:15 ` Werner Almesberger
2004-12-16 9:33 ` Con Kolivas
2004-12-16 13:23 ` Werner Almesberger
2004-12-16 11:12 ` Rajesh Venkatasubramanian
2004-12-16 13:57 ` Werner Almesberger [this message]
2004-12-16 15:04 ` Rajesh Venkatasubramanian
2004-12-16 19:38 ` Werner Almesberger
2004-12-16 20:01 ` Rajesh Venkatasubramanian
2004-12-17 4:44 ` Werner Almesberger
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=20041216105747.T1229@almesberger.net \
--to=werner@almesberger.net \
--cc=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vrajesh@umich.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox