Austin Clements (Gerrit)
unread,Mar 17, 2016, 2:09:16 PM3/17/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Keith Randall, Ian Lance Taylor, Matthew Dempsky, Brad Fitzpatrick, Austin Clements, golang-co...@googlegroups.com
Reviewers: Keith Randall
Austin Clements uploaded a change:
https://go-review.googlesource.com/20774
runtime: document sudog
Change-Id: I85c0bcf02842cc32dbc9bfdcea27efe871173574
---
M src/runtime/runtime2.go
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 8977479..2fc45c3 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -210,6 +210,16 @@
bp uintptr // for GOEXPERIMENT=framepointer
}
+// sudog represents a g in a wait list, such as for sending/receiving
+// on a channel.
+//
+// sudog is necessary because the g ↔ synchronization object relation
+// is many-to-many. A g can be on many wait lists, so there may be
+// many sudogs for one g; and many gs may be waiting on the same
+// synchronization object, so there may be many sudogs for one object.
+//
+// sudogs are allocated from a special pool. Use acquireSudog and
+// releaseSudog to allocated and free them.
type sudog struct {
// The following fields are protected by the hchan.lock of the
// channel this sudog is blocking on. shrinkstack depends on
--
https://go-review.googlesource.com/20774
Gerrit-Reviewer: Keith Randall <
k...@golang.org>