aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2019-04-03 16:32:42 -0400
committerAustin Clements <austin@google.com>2019-04-11 20:38:20 +0000
commit0188cb0e8a7a2355a0eebbf557fc444e5bfa30de (patch)
treea9272a6893ee7523928f475c7308cfa3ff3a3a60 /src/runtime/runtime2.go
parentd86c35e5232744674907fec5bd738dd3fbbf0f53 (diff)
downloadgo-0188cb0e8a7a2355a0eebbf557fc444e5bfa30de.tar.xz
runtime: note about improved _Gscan bit handling
Change-Id: I8de5aa64a24e77e0ef876918fcace7668769ebc2 Reviewed-on: https://go-review.googlesource.com/c/go/+/171022 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index cfea1cd45f..8d749f3d7c 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -22,6 +22,13 @@ const (
// If you add to this list, add to the list
// of "okay during garbage collection" status
// in mgcmark.go too.
+ //
+ // TODO(austin): The _Gscan bit could be much lighter-weight.
+ // For example, we could choose not to run _Gscanrunnable
+ // goroutines found in the run queue, rather than CAS-looping
+ // until they become _Grunnable. And transitions like
+ // _Gscanwaiting -> _Gscanrunnable are actually okay because
+ // they don't affect stack ownership.
// _Gidle means this goroutine was just allocated and has not
// yet been initialized.