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.