Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility. Author: Brian Goetz