[concurrency-interest] Question: Concurrent Memoizer pattern with SoftHashMap

Kwok, Grace (MSCIBARRA) Grace.Kwok at mscibarra.com
Tue Nov 20 18:38:54 EST 2007

Posting again due to posting problem earlier.

Hi all,
    I am refactoring code and would like to use the Memoizer pattern
but I need my cache to be a concurrent soft hash map instead of simply a
// recall the concurrent Memoizer pattern where cache is a
public V compute(final A arg) throws Exception{
   Future<V> f = cache.get(arg);
      Callable<V> eval = new Callable<V>(){....}
    FutureTask<V> ft = new FutureTask<V>(eval);
    f = cache.putIfAbsent(arg, ft);
    if(f == null){
        f = ft;
If I were to base soft hash map on  this,
(search for title "New SoftHashMap")
does anyone has any suggestion of having the Memoizer and SoftHashMap
concepts working together such that I do not need to use explicit
Thanks, Grace

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

More information about the Concurrency-interest mailing list