On Aug 15, 2016 05:21, "Ian Lance Taylor" <i...@golang.org> wrote: > If these approaches seem awkward, I suppose you could get > syscall(syscall.GETCPU, ...) when you want to increment a counter.
That still seems racy: n := syscall(syscall.GETCPU, ...) // The goroutine could be re-scheduled here to another CPU, between these two lines, so n is out of date. array[n]++ // read/writes wrong n, non-atomically. -- 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.