O'Reilly logo
  • Open Jinjie thinks this is interesting:

Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.

From

Cover of Java Concurrency in Practice

Note

锁能保证“可见行”和“原子性”,violatile变量只能保证“可见性”