4 ms·
Agree, in fact this pattern is found almost verbatim in Go's documentation: https://pkg.go.dev/golang.org/x/sync/semaphore#example-package-WorkerPool https://pk
by sprt 6y ago
Agree, in fact this pattern is found almost verbatim in Go's documentation: https://pkg.go.dev/golang.org/x/sync/semaphore#example-package-WorkerPool https://pkg.go.dev/golang.org/x/sync/semaphore#example-packa...
- burnthrow 6y agoGo's Memory Model documentation specifically recommends modeling a counting semaphore with a buffered channel. https://golang.org/ref/mem#tmp_7 https://golang.org/ref/mem#tmp_7