- Unsafe 类提供了硬件级别的原子操作
- Java并发包(java.util.concurrent)中大量使用了CAS操作(比较并替换操作 compareAndSwap)
- AtomicIntegerFieldUpdater,主要是原子性地更新对象的int类型属性,该属性无须被声明成AtomicInteger,也不用synchronized进行同步。
- AtomicReference,AtomicStampedReference与AtomicMarkableReference的区别
详解AtomicReference,AtomicStampedReference与AtomicMarkableReference的区别
5.当多个线程更新用于频繁更新但不太频繁读取的汇总统计信息等目的的公共值时,这个类通常比其他方法更可取。DoubleAccumulator、DoubleAdder、LongAccumulator、LongAdder
调用new DoubleAdder()等价于new DoubleAccumulator((x, y) -> x + y, 0.0)。