Shared State

Noun · Development

Definitions

  1. Mutable data that is accessible by multiple threads, goroutines, or processes simultaneously, making it the primary source of race conditions, deadlocks, and heisenbugs in concurrent programs — mitigated by locks, atomics, or immutable data patterns.

    In plain English: Data that multiple parts of a program can change at the same time, which often leads to hard-to-find bugs if not carefully managed.

    Example: "The flaky test was caused by shared state in a package-level map that two goroutines were reading and writing without a mutex."

Related Terms