hash map
0 人感兴趣 · 3 次引用
- 最新
- 推荐


HashMap 为什么线程不安全?
文章目录线程不安全HashMap的线程不安全体现在会造成死循环、数据丢失、数据覆盖等问题。其中死循环和数据丢失是在JDK1.7中出现的问题,在JDK1.8中已经得到解决,但是1.8中仍会有数据覆盖这样的问题。HashMap是线程不安全的,线程安全场景应该使用Concurrent

0 人感兴趣 · 3 次引用
文章目录线程不安全HashMap的线程不安全体现在会造成死循环、数据丢失、数据覆盖等问题。其中死循环和数据丢失是在JDK1.7中出现的问题,在JDK1.8中已经得到解决,但是1.8中仍会有数据覆盖这样的问题。HashMap是线程不安全的,线程安全场景应该使用Concurrent