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

Tom Hawtin Thomas.Hawtin at Sun.COM
Thu Apr 17 14:28:15 EDT 2008


Bob Lee wrote:
> On Thu, Apr 17, 2008 at 7:32 AM, Jason T. Greene 
> <jason.greene at redhat.com <mailto:jason.greene at redhat.com>> wrote:
> 
>     - Can't do standard equality with weak/soft 
> 
> 
> Standard equality doesn't make sense for weak/soft. Weak/soft references 
> are fundamentally identity based.

Weak certainly. But for soft?

> I agree that it should not delegate, but I doubt we need to copy CHM 
> 100%, especially if we're in the same package.

If it was exposed through an interface and static creation methods (plus 
a serial proxy), the implementation strategy could be hidden. 
Optimisation tradeoffs could then be switched later. OTOH, that is 
different from existing collections.

> I've talked to Doug, in that I've sent him a couple ReferenceMap 
> revisions for review over the past three years. His latest feedback was 
> that he wanted to wait for the new key/value reference type he's been 
> working on, so we've been holding off for that.

http://bugs.sun.com/view_bug.do?bug_id=4630118

If that works out, it makes many things easier.


There's an interesting point from Cliff Click:

http://blogs.azulsystems.com/cliff/2007/08/why-weakhashmap.html

If you "touch" a WeakReference you potentially prevent it from being 
cleared briefly. So there is some danger of ending up with an all 
singing/dancing map and ending up placing a unique WeakReference in the 
key so we never actually have to call get on it.

Tom


More information about the Concurrency-interest mailing list