我需要一个多线程Map对象来在我的Web服务器的缓存中使用,我需要有null密钥.
null
HashMap允许我有空键,但ConcurrentHashMap没有.我试图创建一个HashMap使用的同步版本,Collections.synchronizedMap(new HashMap())但它也不接受null密钥.
HashMap
ConcurrentHashMap
Collections.synchronizedMap(new HashMap())
有没有我可以使用的替代方案,而不必实现某种方式来包装null密钥?
java synchronization hashmap concurrenthashmap
concurrenthashmap ×1
hashmap ×1
java ×1
synchronization ×1