[concurrency-interest] Java ConcurrentWeakHashMap

Peter jini at zeus.net.au
Tue Aug 2 09:18:33 EDT 2016


Would a non blocking concurrent decorator, that lets you choose identity or equality, with any ConcurrentMap implementation of your choice suffice?

Separation of concerns.

You can also choose weak, soft, timed or strong references for keys, values or entry's in any Java Collections implementation.

It can be dependency injected so your object thinks it's using a ConcurrentMap, or any other Java Collections interface for that matter.  And you can change the decorated underlying implementation to which ever one works best for you.



Sent from my Samsung device.
  Include original message
---- Original message ----
From: Shevek <shevek at anarres.org>
Sent: 02/08/2016 05:53:58 am
To: concurrency-interest at cs.oswego.edu
Subject: Re: [concurrency-interest] Java ConcurrentWeakHashMap

It may be a bit heavier than you require, but CacheBuilder can use 
weakKeys and is concurrent.


On 08/01/2016 12:30 PM, i hack 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,
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Concurrency-interest mailing list
Concurrency-interest at cs.oswego.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20160802/8d57a3a4/attachment.html>

More information about the Concurrency-interest mailing list