4.CAS
Java · 2 notes
- 6.4 CAShistorical
1. What it is. To understand CAS, first understand optimistic and pessimistic locking. 1.1. Optimistic vs. pessimistic locking. 1.2. CAS. 2. How to use it.
- 6.43 Atomichistorical
1. What it is. Thread-safe atomic classes implemented with CAS. 2. Usage, using AtomicInteger as an example. 3. Principle analysis. 4. Problems with AtomicInteger: high CPU usage and the ABA problem, plus a version-number solution with AtomicStampedReference.