"there is no guarantee that the write to done will ever be observed by main", i am wondering why the write to done will ever be observed by main in detail?
On Thursday, February 25, 2016 at 8:07:29 AM UTC+8, Nigel Tao wrote: > > On Tue, Feb 23, 2016 at 7:46 AM, Damian Gryski <dgr...@gmail.com > <javascript:>> wrote: > > On Monday, February 22, 2016 at 8:29:59 PM UTC+1, mikew...@gmail.com > wrote: > >> I've been trying to find a way to ignore errors from the golang race > >> detector. In particular I have a stats loop that does stale reads from > for a > >> variable that is updated constantly. In this case I do not care if the > value > >> of the read is stale and I do not want to use atomic operations or > locking > >> to remove this race condition for performance reasons. Does anyone know > if > >> there is a way to add something to the lines of code that read this > value to > >> tell the race detector to ignore errors coming from a specific line of > code? > > > > You might be interested in > > > https://software.intel.com/en-us/blogs/2013/01/06/benign-data-races-what-could-possibly-go-wrong > > > See also the "an aggressive compiler might delete the entire go > statement" and "there is no guarantee that the write to done will ever > be observed by main" examples at https://golang.org/ref/mem > -- 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.