aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.h
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-08-13 22:14:04 +0400
committerDmitriy Vyukov <dvyukov@google.com>2013-08-13 22:14:04 +0400
commitf9066fe1c0a7181242f77d8534e0b6e112c982a9 (patch)
tree1c0a0664c07dd4d6d893319f2e62b9685720b502 /src/pkg/runtime/runtime.h
parentcc4e6aad8ec18b4ee7fe0392f30f229ddb979589 (diff)
downloadgo-f9066fe1c0a7181242f77d8534e0b6e112c982a9.tar.xz
runtime: more reliable preemption
Currently it's possible that a goroutine that periodically executes non-blocking cgo/syscalls is never preempted. This change splits scheduler and syscall ticks to prevent such situation. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/12658045
Diffstat (limited to 'src/pkg/runtime/runtime.h')
-rw-r--r--src/pkg/runtime/runtime.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index a81408f40f..89a42bbca4 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -361,9 +361,10 @@ struct P
{
Lock;
- uint32 status; // one of Pidle/Prunning/...
+ uint32 status; // one of Pidle/Prunning/...
P* link;
- uint32 tick; // incremented on every scheduler or system call
+ uint32 schedtick; // incremented on every scheduler call
+ uint32 syscalltick; // incremented on every system call
M* m; // back-link to associated M (nil if idle)
MCache* mcache;