Re: [go-nuts] Reordering of reads and writes within a goroutine

2017-09-07 Thread Michael Jones
Is it fair to say that this question is a little bit like the fate of Schrödinger's cat? You can't tell when any variable has been set (or perhaps messed up) until you access the variable and that is just that act that causes its multiple possible "messed-up" states to collapse to the right value.

Re: [go-nuts] Reordering of reads and writes within a goroutine

2017-09-07 Thread Ian Lance Taylor
On Thu, Sep 7, 2017 at 3:17 AM, Arpit Aggarwal wrote: > > I was going through the Go memory model at https://golang.org/ref/mem > > In the second line,first paragraph of Happens Before Description it is > written that > > * compilers and processors may reorder the reads and writes executed within

[go-nuts] Reordering of reads and writes within a goroutine

2017-09-07 Thread Arpit Aggarwal
Hi everybody, I was going through the Go memory model at https://golang.org/ref/mem In the second line,first paragraph of Happens Before Description it is written that * compilers and processors may reorder the reads and writes executed within a single goroutine only when the reordering does