[concurrency-interest] How to implement a self populating memoizer cache?

Kevin Bourrillion kevinb at google.com
Wed Nov 3 10:15:02 EDT 2010


On Wed, Nov 3, 2010 at 5:31 AM, Nader Aeinehchi <nader at aeinehchi.com> wrote:

1. Please forgive me for my ignorance, but ExpiringComputingMap does not
> guarantee that a computable to be calculated only once for concurrent
> threads?
>

"Map.get(java.lang.Object)<http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#get(java.lang.Object)>
 either returns an already-computed value for the given key, atomically
computes it using the supplied function, or, if another thread is currently
computing the value for this key, simply waits for that thread to finish and
returns its computed value. Note that the function may be executed
concurrently by multiple threads, but only for distinct keys."


-- 
Kevin Bourrillion @ Google
http://guava-libraries.googlecode.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20101103/5ece6b66/attachment.html>


More information about the Concurrency-interest mailing list