Could it be this:

Initially wait == notify == 0

Waiter Signaler

479 atomic.Xadd(&l.wait, 1) = 1

522 atomic.Load(&l.wait) = 0
atomic.Load(&l.notify) = 0

523 return (because those above are equal)

485 notifyListWait(l, t) (blocked forever)

But looking at your answer, I see that you may imply certain race 
conditions are allowed. Could you explain a bit more on that? Aren't race 
conditions supposedly bad?

If atomic load should always returns the last atomic write to a memory 
location and if I make absolutely sure that the last atomic write finish at 
a specific time instant earlier than the atomic load, I can never get data 
written before that last atomic write, is that what you meant?

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 
For more options, visit

Reply via email to