Files
go-learning/exercises/01-core/07-concurrency/README.md
T

11 lines
515 B
Markdown

# 07 — Współbieżność (`goroutines`, `channels`, `sync.WaitGroup`, `context`)
## Zadania (`concurrency.go`)
1. `ParallelSum(chunks [][]int) int` — policz sumę każdego kawałka równolegle w goroutines (użyj kanału lub `sync.WaitGroup` + `sync/atomic` / mutex) i zwróć łączną sumę.
2. `WaitOrCancel(ctx context.Context, ch <-chan string) (string, error)` — użyj `select` na `ch` i `ctx.Done()`.
## Uruchomienie testów (z `-race`!)
```bash
make test PKG=./exercises/01-core/07-concurrency
```