# WARNING: DATA RACE: Write by goroutine X, Read by goroutine Y (atomic variable)

- **ID:** `go/goroutine-atomic-load-store-mismatch`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Using atomic.Load/Store on a variable that is also accessed non-atomically, causing race.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.4 | active | — | — |
| 1.21 | active | — | — |

## Workarounds

1. **Use atomic operations consistently for all accesses** (95% success)
   ```
   var val atomic.Value
val.Store(42)
v := val.Load().(int)
   ```
2. **Use sync.Mutex to protect all accesses** (90% success)
   ```
   var mu sync.Mutex
var x int
mu.Lock()
x = 42
mu.Unlock()
mu.Lock()
v := x
mu.Unlock()
   ```

## Dead Ends

- **Using volatile keyword (not available in Go)** — Go doesn't have volatile; atomic operations are required. (100% fail)
- **Adding memory barrier manually** — Go's memory model is complex; manual barriers are error-prone. (70% fail)
