# fatal error: concurrent map writes

- **ID:** `go/race-condition-shared-map`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Multiple goroutines writing to the same map without synchronization causes a runtime crash.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   var mu sync.RWMutex
m := make(map[string]int)
// Write
mu.Lock()
m["key"] = 1
mu.Unlock()
// Read
mu.RLock()
val := m["key"]
mu.RUnlock()
   ```
2. **** (90% success)
   ```
   var m sync.Map
m.Store("key", 1)
val, _ := m.Load("key")
   ```

## Dead Ends

- **** — Concurrency issue is not about collisions; it's about data races. (90% fail)
- **** — sync.Map is safe for concurrent writes, but if mixed with regular map, issue persists. (70% fail)
- **** — Sleeps don't synchronize; race remains. (95% fail)
