On Saturday, February 11, 2017 at 4:23:07 PM UTC+8, Axel Wagner wrote:
>
> To expand on Dave's point: Your function has a data race (reads/writes 
> concurrent with writes in different goroutines) and thus its behavior is 
> not defined. Run with the benchmark with -race to confirm. The compiler can 
> pretty much do, what it wants in that case.
>
> You need to add synchronization to eliminate the race. If you try, you'll 
> see that it will behave correctly.
>

ok, not a big problem anyway.
 

>
> On Sat, Feb 11, 2017 at 8:17 AM, Dave Cheney <da...@cheney.net 
> <javascript:>> wrote:
>
>> It's neither, its undefined.
>>
>> --
>> 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...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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, visit https://groups.google.com/d/optout.

Reply via email to