type schedt struct { pidle puintptr; npidle init32,gfree *g; ngfree int32; runqhead guintptr; runqtail guintptr;
sudogcache *sudog; } type g struct { stack stack; shed gobuf;//执行现场 gopc uintptr;//下一条指令地址 startpc uintptr; } type p struct { gfree *g; gfreecnt int32; runqhead guintptr; runqtail guintptr;
sudocache []*sudo;
sudobuf [128]*sudo;
}; type m struct {
g0 *g;
mstartfn func();
curg *g;
p uintptr;
nextp unintptr;
spining bool;//自旋锁
park note; //
shedlink muintptr; //链表 };
type mcache struct {
alloc [xx]*span;
stackcache [xx]*stackfreelist;
};
type sudog struct {
g *g;
elem unsafe.Pointer;
};