Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agree, in fact this pattern is found almost verbatim in Go's documentation: https://pkg.go.dev/golang.org/x/sync/semaphore#example-packa...


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

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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: