what's the mearning of `sudog` in the channel struct in Go?

Viewed 637

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 Answers

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.

Related