No description
I've commented several times in various forums that basically every time I've seen the “worker goroutine” pattern in Go, there has turned out to be a cleaner implementation using semaphores. This change adds a simple such example. (For more complex usage, I would generally pair the semaphore with an errgroup.Group.) Change-Id: Ibf69ee761d14ba59c1acc6a2d595b4fcf0d8f6d6 Reviewed-on: https://go-review.googlesource.com/75170 Reviewed-by: Ross Light <light@google.com> |
||
|---|---|---|
| errgroup | ||
| semaphore | ||
| singleflight | ||
| syncmap | ||
| AUTHORS | ||
| codereview.cfg | ||
| CONTRIBUTING.md | ||
| CONTRIBUTORS | ||
| LICENSE | ||
| PATENTS | ||
| README.md | ||
Go Sync
This repository provides Go concurrency primitives in addition to the ones provided by the language and "sync" and "sync/atomic" packages.
Download/Install
The easiest way to install is to run go get -u golang.org/x/sync. You can
also manually git clone the repository to $GOPATH/src/golang.org/x/sync.
Report Issues / Send Patches
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the sync repository is located at https://github.com/golang/go/issues. Prefix your issue with "x/sync:" in the subject line, so it is easy to find.