[concurrency-interest] ConcurrentReferenceMap enhancement to 166 - Feedback Requested

Jason T. Greene jason.greene at redhat.com
Wed Apr 16 13:46:25 EDT 2008

We are currently considering the inclusion of a ConcurrentReferenceMap 
into a JSR-166 update. This map supports any combination of weak, soft, 
or strong keys and values with similar performance characteristics to 
ConcurrentHashMap (non-blocking reads, striped writes etc). This map can 
also be configured to use identity checking instead of standard equality 
when locating keys (similar to IdentityHashMap).

At this point, we are looking for feedback, in particular on the API.

Some of the open questions are:

1) Should the IDENTITY_COMPARISONS option apply to values and keys, or 
just to keys as it does now? If not, should there be separate options 
for both?

2) Should the key reference type, and the value reference type be merged 
into the option enum, instead of providing separate parameters? This 
reduces the number of overloaded constructors, but introduces the 
problem of having a combination of mutually exclusive options (WEAK_KEYS 

3) Should the configuration values be exposed via get methods so that 
calling code can introspect the map configuration? Currently none of the 
standard collections allow you to do this (load factor, etc).

4) Should behavioral options be exposed as booleans instead? With only 
one option this makes since; however, depending on the answer to 
question number 1, which would add another option, and some expected GC 
changes to the JVM that would add yet another one, this would introduce 
way too many overloaded constructors.

The javadoc for the initial version is available here:

The source code (public domain) is available here:

It should be noted that the API and implementation are extremely subject 
to change, and are also of pre-release quality, so it is not recommended 
for production usage. Also, these links are just temporary.


Jason T. Greene
JBoss, a division of Red Hat

More information about the Concurrency-interest mailing list