Thx you both for your replies.
Just for sum up all stuff on sync.Pool, can I consider as true the following:
- sync.Pool is faster than channel due some improvement when we use multi-processor machine
- with sync.Pool, you can't defined upper limit (unlike channel)
- with sync.Pool, buffer can be garbage collected even if there are stored into sync.Pool (kind of java.lang.ref.WeakReference)
- with sync.Pool, buffer can be garbage collected even if there are stored into sync.Pool (kind of java.lang.ref.WeakReference)
The take away is, sync.Pool is not a cache, a confirming implementation can throw away everything it is given.