golang 并发任务 数据结构

前端之家收集整理的这篇文章主要介绍了golang 并发任务 数据结构前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
 
 
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;
};
原文链接:https://www.f2er.com/go/187382.html

猜你在找的Go相关文章