Skip to content

Commit

Permalink
sync.Pool
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya43 committed May 31, 2021
1 parent 60721e8 commit 414c0b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,9 @@ cond := sync.NewCond(&mu)
## sync.Once:
- `sync.Once` is used to run one time initialization functions.
- `once.Do(funcValue)` method accepts the initialization function.
- `sync.Once` ensures that only one call to `Do` ever calls the function that is passed in - even on different Goroutines.
- `sync.Once` ensures that only one call to `Do` ever calls the function that is passed in - even on different Goroutines.

-----------

## sync.Pool:
- `sync.Pool` is commonly used for creation of expensive resources. For e.g. database connections, network connections and memory.

0 comments on commit 414c0b7

Please sign in to comment.