My use case is this:
I need to cache a set of strings for frequent read access. The cache is updated by a daemon thread periodically. Moreover, the cache element will never get updated individually, it would always be
set.clear();set.addAll(List)I'm currently using a
HashSet
protected by an ReentrantReadWriteLock
. Is there a better way to do this?