Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys/lib/libkern
On Thu, Nov 22, 2007 at 05:00:32PM +1300, David Sainty wrote:
> It is also often cheaper to insert, and modify the existing node if
> present rather than query before insert, and then repeat the lookup for
> the insert operation too. It's also more "atomic friendly" than query +
> insert, should the tree be doing its own locking.
I guess the critical question here is: how much overhead do you have in
preparing the new node. As soon as you have to allocate memory, just
checking for dups first is way cheaper. That's what makes me believe
that a simple boolean that tells "I was successful" is good enough.
Joerg
Home |
Main Index |
Thread Index |
Old Index