On Aug 22, 2008, at 12:06, Jeremias Maerki wrote:

I think I got it now. I'll clean up the code now, do multi-threading
tests now and then prepare a patch for review.

Just a question in the meantime: What's the purpose of the hash (Object)
function in PropertyCache? It seems to just hash a hash code. At any
rate, when I made sure that I always worked with the hashed hash code,
the whole thing suddenly started working.

This is borrowed from Sun's java.util.HashMap. It defends the map against 'bad' hashCode() implementations (that is: it guarantees proper distribution over the buckets, regardless of the quality of the hashCode() implementation)

BTW, I've upped the minimal bucket count to be equals to the segment
count so a lock on a segment is always the equivalent of a lock of the
set of buckets assigned to the segment. That allows more efficient
cleaning code.

Makes sense.



Reply via email to