【发布时间】:2018-08-26 04:48:39
【问题描述】:
最近,我一直在研究 Go 的源代码。当我查看sync.Pool的细节时,我发现了一个我无法理解的评论。
https://golang.org/src/sync/pool.go?s=1633:1992#L58
// Local per-P Pool appendix.
type poolLocalInternal struct {
private interface{} // Can be used only by the respective P.
shared []interface{} // Can be used by any P.
Mutex // Protects shared.
}
本地 per-P 池附录。
per-P 是什么意思?
只能由各自的P使用
P 是什么意思?
【问题讨论】:
标签: go