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
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
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
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
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
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