Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
sprt
· 5y ago · 0 comments
Agree, in fact this pattern is found almost verbatim in Go's documentation:
https://pkg.go.dev/golang.org/x/sync/semaphore#example-packa...
Comments
[–]
burnthrow
5y ago
Go's Memory Model documentation specifically recommends modeling a counting semaphore with a buffered channel.
https://golang.org/ref/mem#tmp_7