英文:
what's the mearning of `sudog` in the channel struct in Go?
问题
根据Golang源代码:
sudog
是一个等待元素的goroutine。sudog
结构体具有以下元素:
type sudog struct{
g *g
isSelect bool
next *sudog
prev *sudog
elem unsafe.Pointer //数据元素
...
}
我想知道sudog
的隐藏含义是什么?它是什么的缩写?
英文:
According to Golang source code:
A sudog
is simply a goroutine that is waiting on an element. The sudog
struct has these elements
type sudog struct{
g *g
isSelect bool
next *sudog
prev *sudog
elem unsafe.Pointer //data element
...
}
I want to know what's the hidden meaning of sudo
? what's it short for?
答案1
得分: 8
普遍的共识是sudog
是一个伪G
,因为它用于维护G的列表。关于这个问题在https://golang.org/cl/20774上有一些讨论。
英文:
The general consensus is that a sudog
is a pseudo-G
, as it is used to keep a list of G's. There is some discussion on https://golang.org/cl/20774.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论