Necessary to use sync.pool for gc in golang 1.9

85 views
Skip to first unread message

芮峰云

unread,
Mar 20, 2018, 10:21:02 AM3/20/18
to golang-nuts
Necessary to use sync.pool for gc in golang 1.9 ?  

Ian Lance Taylor

unread,
Mar 20, 2018, 10:30:23 AM3/20/18
to 芮峰云, golang-nuts
On Mon, Mar 19, 2018 at 10:51 PM, 芮峰云 <rfyiam...@gmail.com> wrote:
> Necessary to use sync.pool for gc in golang 1.9 ?

No.

It's never necessary to use sync.Pool. sync.Pool is a special purpose
mechanism for more efficient handling of certain memory allocation
patterns. It is not a general purpose tool.

Ian
Reply all
Reply to author
Forward
0 new messages