Subject: Re: CVS commit: src/lib/libpthread
To: None <source-changes@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: source-changes
Date: 10/16/2007 21:05:59
On Tue, Oct 16, 2007 at 07:00:11PM +0100, David Laight wrote:
> Is this a place where you can pick the 'id' in order to make it
> easy to lookup ?
> In which case careful selection of 'id' values can may the lookup
> a simple array index - as I did with process-id lookups in the kernel.

The problem is that the id can be invalid. We normally can assume that
it is just a pointer, but in a few cases, we have to actually check that
it is valid before using it. For those cases, the rb tree provides a
reasonable fast check without the problem of resizing a potentially
large array.

Joerg