Can the following piece of code be rewritten w/o using Collections.synchronizedMap() yet maintaining correctness at concurrency?
Collections.synchronizedMap()
Collections.sy
Cafeine is a popular competitor of Guava cache.
- keys automatically wrapped in weak references - values automatically wrapped in weak or soft references
usage:
LoadingCache graphs = Caffeine.newBuilder() .weakKeys() .weakValues() .build(key -> createExpensiveGraph(key));