Re: [go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-23 Thread buaa . cch
package main import "runtime" var a int func calc() { for i := 0; i < 10; i++ { go func() { for { runtime.RaceDisable() a++ runtime.RaceEnable() } }() } } func main() { calc() } go run -race a.go

Re: [go-nuts] question about asm doc

2018-04-18 Thread buaa . cch
I also wonder if there are some official doc about this stack layout on amd64.. 在 2018年4月18日星期三 UTC+8上午3:48:46,Ian Lance Taylor写道: > > On Tue, Apr 17, 2018 at 9:46 AM, > > wrote: > > here: > > https://github.com/golang/go/files/447163/GoFunctionsInAssembly.pdf > > OK, you'll have to ask Mich

Re: [go-nuts] question about asm doc

2018-04-17 Thread buaa . cch
here: https://github.com/golang/go/files/447163/GoFunctionsInAssembly.pdf 在 2018年4月17日星期二 UTC+8下午10:15:07,Ian Lance Taylor写道: > > On Tue, Apr 17, 2018 at 5:33 AM, > wrote: > > > > Official doc (golang.org/doc/asm) said that: > > > > The SP pseudo-register is a virtual stack pointer used to ref

[go-nuts] question about asm doc

2018-04-17 Thread buaa . cch
Official doc (golang.org/doc/asm) said that: The SP pseudo-register is a virtual stack pointer used to refer to frame-local variables and the arguments being prepared for function calls. It points to the top of the local stack frame, so references should use negative offsets in the range [−fram

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread buaa . cch
sorry for misunderstanfing.. this is not a bug... -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visi

[go-nuts] Re: Unexpect deadlock on select multi channel ?

2018-02-07 Thread buaa . cch
I think this is a bug, I change the logic of main goroutine and the other goroutine, then the deadlock disappeared ```go package main import ( "fmt" "time" ) var ( source = make(chan int) idle = make(chan int, 1) ) func main() { go func() { for { select { case worker := <-source: idle <- work