首页 > TAG信息列表 > tempThread

05 - Volatile伪共享问题与Volatile重排序问题

为什么Volatile不能保证原子性 public class VolatileAtomThread extends Thread { private static volatile int count; public static void main(String[] args) { ArrayList<Thread> threads = new ArrayList<>(); for (int i = 0; i < 10;