|
|
|
sync: explain Pool's intentions
Expand the type's doc comment to make its purpose clear
and discourage misuse.
Patch Set 1 #Patch Set 2 : diff -r fdfc321546e7 https://code.google.com/p/go/ #
Total comments: 1
Patch Set 3 : diff -r fdfc321546e7 https://code.google.com/p/go/ #Patch Set 4 : diff -r fdfc321546e7 https://code.google.com/p/go/ #
Total comments: 2
Patch Set 5 : diff -r 3ac4abe0c760 https://code.google.com/p/go/ #Total messages: 6
|
r
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
|
12 years ago (2013年12月20日 18:02:05 UTC) #1 |
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
R=rsc@golang.org (assigned by r@golang.org)
https://codereview.appspot.com/44680043/diff/20001/src/pkg/sync/pool.go File src/pkg/sync/pool.go (right): https://codereview.appspot.com/44680043/diff/20001/src/pkg/sync/pool.go#newco... src/pkg/sync/pool.go:17: // Pool is not intended for general-purpose free lists. Instead, its i think i'd lead with what it's for instead of what it's not for. some other minor tweaks (good/not appropriate -> appropriate/not appropriate; to be shared -> shared) // Pool's intended use is for free lists maintained in global variables, typically accessed // by multiple goroutines simultaneously. Using a Pool instead of, say, a list allows the // runtime to reclaim entries from the free list when it makes sense to do so. // An appropriate use of sync.Pool is to create a pool of temporary buffers shared between // independent clients of a global resource. On the other hand, if a free list is maintained // as part of an object used only by a single client and freed when the client completes, // implementing that free list as a Pool is not appropriate.
Hello golang-codereviews@googlegroups.com, gobot@golang.org, rsc@golang.org (cc: golang-codereviews@googlegroups.com), Please take another look.
LGTM https://codereview.appspot.com/44680043/diff/60001/src/pkg/sync/pool.go File src/pkg/sync/pool.go (right): https://codereview.appspot.com/44680043/diff/60001/src/pkg/sync/pool.go#newco... src/pkg/sync/pool.go:20: // entries from the pool when it makes sense to do so. An spacespace -> space https://codereview.appspot.com/44680043/diff/60001/src/pkg/sync/pool.go#newco... src/pkg/sync/pool.go:27: // This is an experimental package and might not be released. s/package/type/
*** Submitted as https://code.google.com/p/go/source/detail?r=d9681a334cc4 *** sync: explain Pool's intentions Expand the type's doc comment to make its purpose clear and discourage misuse. R=golang-codereviews, gobot, rsc CC=golang-codereviews https://codereview.appspot.com/44680043