在Go语言中,`sudog`在通道结构中的含义是什么?

huangapple go评论89阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2021年7月29日 10:37:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/68569386.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定