Re: [go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Ian Lance Taylor
On Wed, Aug 31, 2016 at 7:54 PM, Lin Hao wrote: > > I mean, sched.midle is a single linked list, but its mode of operation is > different from sched.runqhead/runqtail, why? (or, Why they used different > structure?) The midle list is a list of M's that aren't doing anything. It doesn't matter wh

Re: [go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Lin Hao
Sorry, I haven't expressed clearly. I didn't suggest anything, just wondering, so I want to ask about it. I mean, sched.midle is a single linked list, but its mode of operation is different from sched.runqhead/runqtail, why? (or, Why they used different structure?) -- You received this message b

Re: [go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Ian Lance Taylor
On Tue, Aug 30, 2016 at 10:19 PM, Lin Hao wrote: > > I'm reading the runtime code, and there are some questions, as shown below: > > func globrunqput(gp *g) { > gp.schedlink = 0 > if sched.runqtail != 0 { > sched.runqtail.ptr().schedlink.set(gp)// My question: why? > > // I feel should be

[go-nuts] About runtime.globrunqput/globrunqputhead

2016-08-31 Thread Lin Hao
Hi, all: I'm reading the runtime code, and there are some questions, as shown below: func globrunqput(gp *g) { gp.schedlink = 0 if sched.runqtail != 0 { sched.runqtail.ptr().schedlink.set(gp)// My question: why? /