“Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.”
“Visible things can be invisible. However, our powers of thought grasp both the visible and the invisible – and I make use of painting to render thoughts visible.”
“Compound actions on shared state, such as incrementing a hit counter (read-modify-write) or lazy initialization (check-then-act), must be made atomic to avoid race conditions. Holding a lock for the entire duration of a compound action can make that compound action atomic. However, just wrapping the compound action with a synchronized block is not sufficient; if synchronization is used to coordinate access to a variable, it is needed everywhere that variable is accessed. Further, when using locks to coordinate access to a variable, the same lock must be used wherever that variable is accessed.”
“You can't guarantee success, but you can guarantee failure.”
“Man is guaranteed only those rights which he can defend.”
“You can only take steps toward the future you want. It's not guaranteed to be there.”