[concurrency-interest] Bug in CustomConcurrentHashMap.KeySet.intern()

Manuel Dominguez Sarmiento mads at renxo.com
Tue Jun 30 11:16:26 EDT 2009

Hi Doug,

Thanks for the update. I noticed that several projects are using some 
form or another of ConcurrentReferenceHashMap, which I believe is the 
precursor to CustomConcurrentHashMap (for instance, JBoss Remoting as 
well as a few others are using these on their releases). Are these 
versions any more stable? If so, were can I find the latest source (I 
can only find CustomConcurrentHashMap in CVS).


Ing. Manuel Dominguez Sarmiento
Director General
Renxo S.A.
e-mail:	mads at renxo.com
Phone:	+54 11 4719 6806, ext. 104

Doug Lea wrote:
> Manuel Dominguez Sarmiento wrote:
>> Hi,
>> I found that CustomConcurrentHashMap.KeySet.intern() was the perfect 
>> fit for the object interning need we're having with a current project. 
>> However, doPut() returns null when a key is first added to the map. 
>> It could be easily fixed as follows:
>>        public K intern(K e) {
>>            K oldElement = cchm.doPut(e, e, true);
>>            return (oldElement != null) ? oldElement : e;
>>        }
> Thanks! Fixed.
>> BTW, how stable is this preview release for production use? Any caveats?
> Not at all stable. The version there was checked in to
> allow discussion about how to support various cache-like
> uses (which is among the main reasons for people to use it.)
> Which led to some explorations on my part on
> how to efficiently support customized eviction policies
> Which has in turn led to various diversions on concurrent
> (and non-concurrent) hashing that further stall getting
> this in releasable form.
> The Map functionality has been well-tested, but as you saw, the
> auxiliary functionality hasn't.
> (While I'm at it: I will be away tomorrow (July 1) through
> July 14 so might not respond to mail promptly.)
> -Doug

More information about the Concurrency-interest mailing list