diff options
author | Andy Pan <panjf2000@gmail.com> | 2021-04-23 21:25:06 +0800 |
---|---|---|
committer | Michael Pratt <mpratt@google.com> | 2021-05-05 15:53:20 +0000 |
commit | 3b304ce7fe35b9d1e8cf0b0518ed2550c361a010 (patch) | |
tree | ad92c193eb9dd4778e57ebb22c98267be875ce23 /src/runtime/runtime2.go | |
parent | f34fe8e370f8bd910640fa49bb4d93e910145193 (diff) | |
download | go-3b304ce7fe35b9d1e8cf0b0518ed2550c361a010.tar.gz go-3b304ce7fe35b9d1e8cf0b0518ed2550c361a010.zip |
runtime: implement runqdrain() for GC mark worker goroutines
Revive CL 310149
Change-Id: Ib4714ea5b2ade32c0f66edff841a79d8212bd79a
Reviewed-on: https://go-review.googlesource.com/c/go/+/313009
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Pratt <mpratt@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r-- | src/runtime/runtime2.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 7fc7174334..0e0eb0b728 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -633,6 +633,9 @@ type p struct { // unit and eliminates the (potentially large) scheduling // latency that otherwise arises from adding the ready'd // goroutines to the end of the run queue. + // + // Note that while other P's may atomically CAS this to zero, + // only the owner P can CAS it to a valid G. runnext guintptr // Available G's (status == Gdead) |