The 'sync' Package
This lesson lists down the other features that come in handy to implement concurrency from the `sync` Package.
So far, you are familiar with WaitGroups
and Mutex
from the sync
package.
Here are some other features in Go from the sync
Package:
- Pool: A
Pool
is a collection of temporary objects which can be accessed and saved by many goroutines simultaneously. - Once: A
Once
is an object that performs an action only once. - Cond: A
Cond
implements a condition variable which indicates the goroutines which are waiting for an event or want to announce an event.
You can try exploring them on your own as they will come in handy for you while writing concurrent programs in Go.
Get hands-on with 1400+ tech skills courses.