lkml.org 
[lkml]   [1999]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: AVL trees vs. Red-Black trees
On Sun, 28 Nov 1999, Jamie Lokier wrote:

> Oliver Xymoron wrote:
> > > If somebody find this interesting I can provide a patch to add the
> > > include/linux/rbtree.h and lib/rbtree.c that will provde rbtree support.
> >
> > I'd like to take a look at this, I've been looking at putting some more
> > uniform tree structures in the kernel (post 2.4).
>
> fwiw, I did a splay tree (aka. self-adjusting tree) for similar reasons
> that anyone is welcome to take a peek at. The self-adjusting property
> should theoretically provide cache-like behaviour when most of the
> lookups are to relatively few nodes in the tree. The downside is that
> the tree is modified by lookups.

Unfortunately, that means that there's no way it can even begin to scale
on SMP - all "readers" need exclusive locks unless you can somehow
guarantee that there'll only ever be one reader/writer. In some instances,
it might make sense to have completely unlocked per-processor trees
mapping onto shared structures, but it seems a little painful.

--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.370 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site