# fatal error: all goroutines are asleep - deadlock! (with 2 channels)

- **ID:** `go/deadlock-multiple-channels`
- **Domain:** go
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Two goroutines each waiting on a channel that the other is supposed to send to, causing a circular wait.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   ch1 := make(chan int)
ch2 := make(chan int)
go func() { ch1 <- 1; <-ch2 }()
go func() { ch2 <- 2; <-ch1 }()
   ```
2. **** (85% success)
   ```
   select {
case v := <-ch1:
    // handle
case <-time.After(time.Second):
    // timeout
}
   ```

## Dead Ends

- **** — Buffers only help if sends don't block; in circular wait, both block indefinitely. (80% fail)
- **** — If both use timeouts, they may repeatedly timeout without progress. (60% fail)
- **** — More goroutines don't resolve circular dependency; they may also block. (70% fail)
