f you’ve used Go for a while you’re probably aware of some of the basic Go concurrency primitives:
gokeyword for spawning goroutines
- Channels, for communicating between goroutines
contextpackage for propagating cancellation
sync/atomicpackages for lower-level primitives such as mutexes and atomic memory access
These language features and packages combine to provide a very rich set of tools for building concurrent applications. What you might not have discovered yet is a set of higher-level concurrency primitives available in the “extended standard library” available at golang.org/x/sync. We’ll be taking a look at these in this article.