# fatal error: concurrent map iteration and map write

- **ID:** `go/concurrent-map-iteration-and-write`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A goroutine iterates a map with range while another goroutine writes to it, which the runtime flags as a fatal race.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0+ | active | — | — |

## Workarounds

1. **** (93% success)
   ```
   Hold an RWMutex read lock for the whole iteration and use a write lock for mutations.
   ```
2. **** (88% success)
   ```
   Snapshot the map under a lock into a plain slice, then iterate the slice outside the lock.
   ```

## Dead Ends

- **** — The write still races with the copy loop and can panic during the copy itself. (70% fail)
