---
title: "Meaning & Key Takeaway of: Whenever more than one thread accesses a…"
description: "\"“Whenever more than one thread accesses a given state variable, and one of them might write to it, they all must coordinate their access to it using sy..."
image: "https://sms4smile.com/quotes/i/134/brian-goetz-35377_concurrency_whenever-more-than-one-thread-accesses-a_723317.jpg"
---

#  Whenever more than one thread accesses a given state…

![“Whenever more than one thread accesses a given state variable, and one of them might write to it, they all must coordinate their access to it using synchronization.” quote by Brian Goetz](https://sms4smile.com/quotes/i/134/brian-goetz-35377_concurrency_whenever-more-than-one-thread-accesses-a_723317.jpg)   [Download](https://sms4smile.com/quotes/i/134/brian-goetz-35377_concurrency_whenever-more-than-one-thread-accesses-a_723317.jpg) [Open image](https://sms4smile.com/quotes/i/134/brian-goetz-35377_concurrency_whenever-more-than-one-thread-accesses-a_723317.jpg)

> ““Whenever more than one thread accesses a given state variable, and one of them might write to it, they all must coordinate their access to it using synchronization.””

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

When multiple threads share a variable and any may modify it, they must use synchronization to avoid race conditions and ensure correct behavior.

**In simple terms:** Threads need coordination to safely share data.

Key Takeaway

Always synchronize shared mutable state.

Themes

concurrency thread safety programming

Mood

cautious technical

Type

educational practical

When to use this quote

- multithreaded applications
- shared resources
- parallel processing

Key Concepts

synchronization race conditions mutability

Questions to Reflect On

- How do you decide when to synchronize?
- What alternatives exist to lock-based coordination?

A Different Perspective

Synchronization adds overhead and can reduce performance if overused.

★ ★ ★ ★ ★   No ratings yet

[Concurrency](https://sms4smile.com/quotes/about/concurrency/) [Programming](https://sms4smile.com/quotes/about/programming/) [Technology](https://sms4smile.com/quotes/about/technology/)

## Related quotes

> [“From the perspective of a class C, an alien method is one whose behavior is not fully specified by C. This includes methods in…](https://sms4smile.com/quotes/brian-goetz/from-the-perspective-of-a-class-c-an-alien-method-is-one-whose/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“When a field is declared volatile, the compiler and runtime are put on notice that this variable is shared and that operations on it…](https://sms4smile.com/quotes/brian-goetz/when-a-field-is-declared-volatile-the-compiler-and-runtime-are-put-on/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Sometimes abstraction and encapsulation are at odds with performance — although not nearly as often as many developers believe — but it is always…](https://sms4smile.com/quotes/brian-goetz/sometimes-abstraction-and-encapsulation-are-at-odds-with-performance/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“It is far easier to design a class to be thread-safe than to retrofit it for thread safety later.”](https://sms4smile.com/quotes/brian-goetz/it-is-far-easier-to-design-a-class-to-be-thread-safe-than-to-retrofit/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.”](https://sms4smile.com/quotes/brian-goetz/locking-can-guarantee-both-visibility-and-atomicity-volatile/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Immutable objects are simple. They can only be in one state, which is carefully controlled by the constructor. One of the most difficult elements…](https://sms4smile.com/quotes/brian-goetz/immutable-objects-are-simple-they-can-only-be-in-one-state-which-is/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“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.…](https://sms4smile.com/quotes/brian-goetz/compound-actions-on-shared-state-such-as-incrementing-a-hit-counter/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Debugging tip: For server applications, be sure to always specify the -server JVM command line switch when invoking the JVM, even for development and…](https://sms4smile.com/quotes/brian-goetz/debugging-tip-for-server-applications-be-sure-to-always-specify-the/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Accessing shared, mutable data requires using synchronization; one way to avoid this requirement is to not share. If data is only accessed from a…](https://sms4smile.com/quotes/brian-goetz/accessing-shared-mutable-data-requires-using-synchronization-one-way/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“The possibility of incorrect results in the presence of unlucky timing is so important in concurrent programming that it has a name: a race…](https://sms4smile.com/quotes/brian-goetz/the-possibility-of-incorrect-results-in-the-presence-of-unlucky/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Just as it is a good practice to make all fields private unless they need greater visibility, it is a good practice to make…](https://sms4smile.com/quotes/brian-goetz/just-as-it-is-a-good-practice-to-make-all-fields-private-unless-they/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Once an object escapes, you have to assume that another class or thread may, maliciously or carelessly, misuse it. This is a compelling reason…](https://sms4smile.com/quotes/brian-goetz/once-an-object-escapes-you-have-to-assume-that-another-class-or/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“The insight-driven digital transformation can create synchronization of all functions running seamlessly.”](https://sms4smile.com/quotes/pearl-zhu/the-insight-driven-digital-transformation-can-create-synchronization/)

[Pearl Zhu](https://sms4smile.com/quotes/author/pearl-zhu/)

> [“Dropbox needed to test its leap-of-faith question: if we can provide a superior customer experience, will people give our product a try? They believed—rightly,…](https://sms4smile.com/quotes/eric-ries/dropbox-needed-to-test-its-leap-of-faith-question-if-we-can-provide-a/)

[Eric Ries](https://sms4smile.com/quotes/author/eric-ries/)

> [“Automatic synchronization is the killer feature of Dropbox, something that will save lots of time and streamline collaboration.”](https://sms4smile.com/quotes/ian-lamont/automatic-synchronization-is-the-killer-feature-of-dropbox-something/)

[Ian Lamont](https://sms4smile.com/quotes/author/ian-lamont/)

## More by Brian Goetz

> [“From the perspective of a class C, an alien method is one whose behavior is not fully specified by C. This includes methods in…](https://sms4smile.com/quotes/brian-goetz/from-the-perspective-of-a-class-c-an-alien-method-is-one-whose/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Once an object escapes, you have to assume that another class or thread may, maliciously or carelessly, misuse it. This is a compelling reason…](https://sms4smile.com/quotes/brian-goetz/once-an-object-escapes-you-have-to-assume-that-another-class-or/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Just as it is a good practice to make all fields private unless they need greater visibility, it is a good practice to make…](https://sms4smile.com/quotes/brian-goetz/just-as-it-is-a-good-practice-to-make-all-fields-private-unless-they/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“The possibility of incorrect results in the presence of unlucky timing is so important in concurrent programming that it has a name: a race…](https://sms4smile.com/quotes/brian-goetz/the-possibility-of-incorrect-results-in-the-presence-of-unlucky/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Accessing shared, mutable data requires using synchronization; one way to avoid this requirement is to not share. If data is only accessed from a…](https://sms4smile.com/quotes/brian-goetz/accessing-shared-mutable-data-requires-using-synchronization-one-way/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Debugging tip: For server applications, be sure to always specify the -server JVM command line switch when invoking the JVM, even for development and…](https://sms4smile.com/quotes/brian-goetz/debugging-tip-for-server-applications-be-sure-to-always-specify-the/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Immutable objects are simple. They can only be in one state, which is carefully controlled by the constructor. One of the most difficult elements…](https://sms4smile.com/quotes/brian-goetz/immutable-objects-are-simple-they-can-only-be-in-one-state-which-is/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.”](https://sms4smile.com/quotes/brian-goetz/locking-can-guarantee-both-visibility-and-atomicity-volatile/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“It is far easier to design a class to be thread-safe than to retrofit it for thread safety later.”](https://sms4smile.com/quotes/brian-goetz/it-is-far-easier-to-design-a-class-to-be-thread-safe-than-to-retrofit/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Sometimes abstraction and encapsulation are at odds with performance — although not nearly as often as many developers believe — but it is always…](https://sms4smile.com/quotes/brian-goetz/sometimes-abstraction-and-encapsulation-are-at-odds-with-performance/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“When a field is declared volatile, the compiler and runtime are put on notice that this variable is shared and that operations on it…](https://sms4smile.com/quotes/brian-goetz/when-a-field-is-declared-volatile-the-compiler-and-runtime-are-put-on/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“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.…](https://sms4smile.com/quotes/brian-goetz/compound-actions-on-shared-state-such-as-incrementing-a-hit-counter/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

[Explore all 13 Brian Goetz quotes ](https://sms4smile.com/quotes/author/brian-goetz/)

## More Concurrency quotes

> [“From the perspective of a class C, an alien method is one whose behavior is not fully specified by C. This includes methods in…](https://sms4smile.com/quotes/brian-goetz/from-the-perspective-of-a-class-c-an-alien-method-is-one-whose/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Once an object escapes, you have to assume that another class or thread may, maliciously or carelessly, misuse it. This is a compelling reason…](https://sms4smile.com/quotes/brian-goetz/once-an-object-escapes-you-have-to-assume-that-another-class-or/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Just as it is a good practice to make all fields private unless they need greater visibility, it is a good practice to make…](https://sms4smile.com/quotes/brian-goetz/just-as-it-is-a-good-practice-to-make-all-fields-private-unless-they/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“The possibility of incorrect results in the presence of unlucky timing is so important in concurrent programming that it has a name: a race…](https://sms4smile.com/quotes/brian-goetz/the-possibility-of-incorrect-results-in-the-presence-of-unlucky/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Accessing shared, mutable data requires using synchronization; one way to avoid this requirement is to not share. If data is only accessed from a…](https://sms4smile.com/quotes/brian-goetz/accessing-shared-mutable-data-requires-using-synchronization-one-way/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Debugging tip: For server applications, be sure to always specify the -server JVM command line switch when invoking the JVM, even for development and…](https://sms4smile.com/quotes/brian-goetz/debugging-tip-for-server-applications-be-sure-to-always-specify-the/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Immutable objects are simple. They can only be in one state, which is carefully controlled by the constructor. One of the most difficult elements…](https://sms4smile.com/quotes/brian-goetz/immutable-objects-are-simple-they-can-only-be-in-one-state-which-is/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Locking can guarantee both visibility and atomicity; volatile variables can only guarantee visibility.”](https://sms4smile.com/quotes/brian-goetz/locking-can-guarantee-both-visibility-and-atomicity-volatile/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“It is far easier to design a class to be thread-safe than to retrofit it for thread safety later.”](https://sms4smile.com/quotes/brian-goetz/it-is-far-easier-to-design-a-class-to-be-thread-safe-than-to-retrofit/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“Sometimes abstraction and encapsulation are at odds with performance — although not nearly as often as many developers believe — but it is always…](https://sms4smile.com/quotes/brian-goetz/sometimes-abstraction-and-encapsulation-are-at-odds-with-performance/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“When a field is declared volatile, the compiler and runtime are put on notice that this variable is shared and that operations on it…](https://sms4smile.com/quotes/brian-goetz/when-a-field-is-declared-volatile-the-compiler-and-runtime-are-put-on/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

> [“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.…](https://sms4smile.com/quotes/brian-goetz/compound-actions-on-shared-state-such-as-incrementing-a-hit-counter/)

[Brian Goetz](https://sms4smile.com/quotes/author/brian-goetz/)

[Browse all 13 Concurrency quotes ](https://sms4smile.com/quotes/about/concurrency/)

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "“Whenever more than one thread accesses a given state variable, and one of them might write to it, they all must coordinate their access to it using synchronization.”",
            "creator": {
                "@type": "Person",
                "name": "Brian Goetz"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/brian-goetz/whenever-more-than-one-thread-accesses-a-given-state-variable-and-one/",
            "about": {
                "@type": "Thing",
                "name": "Concurrency"
            },
            "@id": "https://sms4smile.com/quotes/brian-goetz/whenever-more-than-one-thread-accesses-a-given-state-variable-and-one/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/134/brian-goetz-35377_concurrency_whenever-more-than-one-thread-accesses-a_723317.jpg",
                "contentUrl": "https://sms4smile.com/quotes/i/134/brian-goetz-35377_concurrency_whenever-more-than-one-thread-accesses-a_723317.jpg",
                "url": "https://sms4smile.com/quotes/i/134/brian-goetz-35377_concurrency_whenever-more-than-one-thread-accesses-a_723317.jpg",
                "width": 1080,
                "height": 1080,
                "caption": "“Whenever more than one thread accesses a given state variable, and one of them might write to it, they all…” — Brian Goetz",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "Brian Goetz",
                    "item": "https://sms4smile.com/quotes/author/brian-goetz/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "“Whenever more than one thread accesses...",
                    "item": "https://sms4smile.com/quotes/brian-goetz/whenever-more-than-one-thread-accesses-a-given-state-variable-and-one/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/brian-goetz/whenever-more-than-one-thread-accesses-a-given-state-variable-and-one/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
