diff options
| author | Austin Clements <austin@google.com> | 2018-08-09 23:47:37 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2018-08-20 18:19:22 +0000 |
| commit | 3578918b6614effaeaa581687d810b74e342e0f8 (patch) | |
| tree | 555f4a6154463a0434bd2b7bd1be521306007a63 /src/runtime/runtime2.go | |
| parent | 723479bc30f998f29ecbba7caea118ac4e2c9afd (diff) | |
| download | go-3578918b6614effaeaa581687d810b74e342e0f8.tar.xz | |
runtime: replace manually managed G dequeues with a type
There are two manually managed G dequeues. Abstract these both into a
shared gQueue type. This also introduces a gList type, which we'll use
to replace several manually-managed G lists in follow-up CLs.
This makes the code more readable and maintainable. gcFlushBgCredit in
particular becomes much easier to follow. It also makes it easier to
introduce more G queues in the future. Finally, the gList type clearly
distinguishes between lists of Gs and individual Gs; currently both
are represented by a *g, which can easily lead to confusion and bugs.
Change-Id: Ic7798841b405d311fc8b6aa5a958ffa4c7993c6c
Reviewed-on: https://go-review.googlesource.com/129396
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
| -rw-r--r-- | src/runtime/runtime2.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index ad47d1275e..5bd37e49be 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -574,8 +574,7 @@ type schedt struct { nmspinning uint32 // See "Worker thread parking/unparking" comment in proc.go. // Global runnable queue. - runqhead guintptr - runqtail guintptr + runq gQueue runqsize int32 // Global cache of dead G's. |
