[go-nuts] Re: Go Memory Model question

2022-12-02 Thread peterGo
Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access. https://go.dev/ref/mem $ go run -race racer.go 00 == WARNING: DATA RACE Write at 0x0054d5f8 by goroutine 6: main.main.func1() /home/peter/racer.go:7 +0x29

[go-nuts] Re: Go Memory Model question

2022-12-02 Thread のびしー
> So the second read can observe x = 0 even if the first read observes x = 0. Sorry, I meant "So the second read can observe x = 0 even if the first read observes x = 1." here. 2022年12月2日(金) 21:10 のびしー : > Hello, I have another question regarding the Go Memory Model. > > (1) Can this program pri