>
> Writing to adjacent memory locations [i.e. different array elements, from 
> different goroutines] will cause false sharing between CPU caches. This is 
> a performance, not a correctness issue. 
>

I'm looking to make an array of thread-safe counters - each counting a 
different thing.  I propose to use an ordinary array, of fixed size, with 
thread safety coming solely from use of atomic operations to increment the 
values.  Will it be correct, but prone to false sharing between caches?

-- 
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