Hi, I just read the commit from 
https://go-review.googlesource.com/c/go/+/166960 and it said the reason to 
use lock-free is because when using mutex  "Clearing must zero out the 
pointer to every object in every Pool to prevent a concurrent slow path 
from causing all objects to be retained. Since this happens during STW, 
this has an O(# objects in Pools) effect on STW time."
I just can't understand why concurrent Get and clearPool will cause all 
objects to be retained. Thank in advance for any help!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/bacb3c88-4ad4-44ca-a8b4-34d624820f68%40googlegroups.com.

Reply via email to