golangGMP 图片截取知乎
但本地队列没有可运行的goroutine,会有steal机制,从从其他P里获取可运行的G,本地队列运行顺序为先从本地队列查询,全局队列查询,然后再从其他P里偷取,具体源码在runtime的proc.go里
//Findsarunnablegoroutinetoexecute.
//TriestostealfromotherP's,getgfromlocalorglobalqueue,pollnetwork.
funcfindrunnable()(gp*g,inhe