From 353ce60f6e8e5898efec62945fbafd33bc28a37b Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Sat, 23 Feb 2013 08:48:02 +0400 Subject: runtime: implement local work queues (in preparation for new scheduler) R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7402047 --- src/pkg/runtime/runtime.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/pkg/runtime/runtime.h') diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index 24591995c8..61e33eb95e 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -52,6 +52,7 @@ typedef struct G G; typedef struct Gobuf Gobuf; typedef union Lock Lock; typedef struct M M; +typedef struct P P; typedef struct Mem Mem; typedef union Note Note; typedef struct Slice Slice; @@ -312,6 +313,17 @@ struct M uintptr end[]; }; +struct P +{ + Lock; + + // Queue of runnable goroutines. + G** runq; + int32 runqhead; + int32 runqtail; + int32 runqsize; +}; + // The m->locked word holds a single bit saying whether // external calls to LockOSThread are in effect, and then a counter // of the internal nesting depth of lockOSThread / unlockOSThread. -- cgit v1.3-5-g9baa