Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Sorry, my mistake!

Author: h.g.muller

Date: 01:46:25 02/08/06

Go up one level in this thread


On February 07, 2006 at 17:44:23, Gerd Isenberg wrote:

>
>very nice idea to traverse four 16-byte entries of a cacheline.
>I actually do something like this...
>
>if(TP[hash&=~63].lock==key ||
>   TP[hash+= 16].lock==key ||
>   TP[hash+= 16].lock==key ||
>   TP[hash+= 16].lock==key)
>{/* process hit at TP[hash] */}
>else
>{/* process miss */}

This is also a good way to prevent overruns into the next cache line (which, for
efficiency, is the dominant concern). It has the disadvantage compared to the
'xor method' that all first accesses are directed to only a quarter of the hash
table, leading to a larger collision rate: if the table is half full, half of
the filled entries can only be reached by a retry (and in practice more, because
some of the cache lines will stay empty due to Poisson statistics). With the xor
method most entries will still be found in the place where you first look, in
that case.

This is important: although the retries are in the same cache line, they are
still in memory words that are loaded in the cache with appreciable latency
compared to the original miss-word.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.