On Friday, February 1, 2019 at 11:11:24 AM UTC-5, robert engels wrote:
>
>
> for {
>    if A.a > 100 {
>       break
> }
>
>
> Go routine #2 may never see the value of A.a change and so never exit the 
> loop.
>

I'm confused. I can see how that would fail if the test were A.a == 100 
since Go routine #1 might increment past 100 before #2 ,  but as written it 
seems wrong only if the application logic depends on Go routine #2 exiting 
the loop as soon as A.a reaches 100 (as opposed to any time afterward.) 

What am I missing?


>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to