]> Cypherpunks repositories - gostls13.git/commit
runtime: do not park sysmon thread if any goroutines are running
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 31 Jul 2013 15:59:27 +0000 (19:59 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 31 Jul 2013 15:59:27 +0000 (19:59 +0400)
commit156e8b306d009ef118a4138f34098c8c41976a08
tree1a23efa6ba8b1d675e3ac2727b207c8fd7e96c9e
parente8018fbebe2e6e86f94111b21c5749ebeea15dbd
runtime: do not park sysmon thread if any goroutines are running
Sysmon thread parks if no goroutines are running (runtime.sched.npidle == runtime.gomaxprocs).
Currently it's unparked when a goroutine enters syscall, it was enough
to retake P's from blocking syscalls.
But it's not enough for reliable goroutine preemption. We need to ensure that
sysmon runs if any goroutines are running.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12167043
src/pkg/runtime/proc.c