[concurrency-interest] Java ConcurrentWeakHashMap

Benjamin Manes ben.manes at gmail.com
Mon Aug 1 16:50:10 EDT 2016


Guava's internally has a pluggable equality mechanism, but only exposes
identity as the most applicable in the observed use-cases. See
Interners#newWeakInterner() where equality is leveraged. It was difficult
to find other use-cases where equality was the correct choice, so to reduce
maintenance burden and user error the capability wasn't externalized.

There are a lot of other implementations though, e.g. search for
ConcurrentReferenceHashMap.

On Mon, Aug 1, 2016 at 12:30 PM, i hack <idontcareifigethacked at gmail.com>
wrote:

> I can't find one in the JDK.
> Guava has one similar but it uses identity, I need it with equality.
>
>
> http://stackoverflow.com/questions/2255950/is-there-java-concurrent-util-or-equivalent-for-weakhashmap
>
> http://stackoverflow.com/questions/31875264/is-there-a-non-jdk-implementation-for-a-concurrent-weak-hash-map
>
> I came across these on the mailing list (from 3 1/2 yrs ago...):
>
> http://concurrency.markmail.org/search/?q=weakconcurrenthashmap#query:weakconcurrenthashmap%20order%3Arelevance+page:1+mid:swesuutrmb44jt2y+state:results
> http://gee.cs.oswego.edu/dl/jsr166/dist/extra166ydocs/
>
> But don't know what is the best option, if there is one, as of today, to
> use a ConcurrentWeakHashMap, without rolling my own.
>
> Thanks,
> IDC
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20160801/60dba0bd/attachment.html>


More information about the Concurrency-interest mailing list