Multithreaded java cache for objects that are heavy to create ?

Posted by krosenvold on Stack Overflow See other posts from Stack Overflow or by krosenvold
Published on 2010-05-05T06:10:05Z Indexed on 2010/05/05 6:18 UTC
Read the original article Hit count: 162

Filed under:
|
|

I need a cache some objects with fairly heavy creation times, and I need exactly-once creation semantics. It should be possible to create objects for different CacheKeys concurrently. I think I need something that (under the hood) does something like this:

ConcurrentHashMap<CacheKey, Future<HeavyObject>>

Are there any existing open-source implementations of this that I can re-use ?

© Stack Overflow or respective owner

Related posts about java

Related posts about concurrency