Multithreaded java cache for objects that are heavy to create ?
- by krosenvold
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 ?