[concurrency-interest] RFC -- Java7 java.util.concurrent plans

Jason T. Greene jason.greene at redhat.com
Fri Dec 12 17:46:43 EST 2008


Bob Lee wrote:
> On Tue, Dec 9, 2008 at 4:35 PM, Doug Lea <dl at cs.oswego.edu 
> <mailto:dl at cs.oswego.edu>> wrote:
> 
>     3. ConcurrentReferenceHashMap
>       A concurrent hash map allowing weak, soft, etc keys and values.
> 
> 
> BTW, I like the name "ReferenceMap" better. 
> 
>   - It's obviously concurrent because it's in the "concurrent" package.
>   - It doesn't makes sense to use anything but a hash-based 
> implementation with references.

Good points.

>   - We won't want a non-concurrent reference map because it will retain 
> garbage for too long.

I am not so sure about this one. Once there are ephemerons the value 
reference would be cleaned up with the key. If ephemerons aren't 
available, it could be possible to have eager value collection where a 
cleanup thread nullifies the value reference. The only garbage that 
would remain in that case would be a Entry object. Writes would then 
just replace the "tombstoned" entries (potentially cleaning up others).

--
Jason T. Greene
JBoss, a division of Red Hat


More information about the Concurrency-interest mailing list