Skip to content

Concurrency Quote by Brian Goetz

“Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.” quote by Brian Goetz
Download Open image
““Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.””

Brian Goetz

About This Quote

Source Book: Java Concurrency in Practice, 2006

The statement explains that using lock constructs ensures both that changes are seen by other threads and that operations happen indivisibly, whereas volatile only ensures visibility, not atomicity.

In simple terms: Locks give visibility and atomicity; volatile gives only visibility.

Key Takeaway

Use locks when you need both safety and visibility.

Themes

concurrency thread safety memory model

Mood

technical analytical

Type

educational technical

When to use this quote

  • multithreaded programming
  • shared data structures
  • performance optimization

Key Concepts

locking volatile atomicity visibility

Questions to Reflect On

  • When is volatile sufficient?
  • How to minimize lock contention?
A Different Perspective

Locks can cause contention and reduce scalability.

2.9 out of 5 (4 ratings)

More by Brian Goetz

Explore all 13 Brian Goetz quotes

More Concurrency quotes

Browse all 13 Concurrency quotes