Hacker News new | ask | show | jobs
by sprt 1972 days ago
Agree, in fact this pattern is found almost verbatim in Go's documentation: https://pkg.go.dev/golang.org/x/sync/semaphore#example-packa...
1 comments

Go's Memory Model documentation specifically recommends modeling a counting semaphore with a buffered channel.

https://golang.org/ref/mem#tmp_7