Ways to make non-synchronized data structure thread safe

Viewed 640

I am wondering is there any other way to make a non-synchronized data structure to be thread safe other than using synchronized data structure like Hashtable and Vector, or using a wrapper like Collections.synchronizedList(List<T> arg) or Collections.synchronizedMap(Map<K,V> arg) ?

I was asked on the interview that how to make a hashmap thread safe, and I told him to use Hashtable or ConcurrentHashMap or use the Collections.synchronizedMap wrapper, however, seems like these answers is not what he is looking for

2 Answers
Related