4 ms·
It depends far more on memory access patterns. If memory is accessed linearly (backwards or forwards now) the prefetcher will get it for you before you get to
by CyberDildonics 8y ago
It depends far more on memory access patterns. If memory is accessed linearly (backwards or forwards now) the prefetcher will get it for you before you get to it.
Alignment matter much more when using atomics. X64 can do unaligned atomic access although (I think) there is a penalty for crossing the cache line boundary with atomics. Also there is an issue of 'false sharing' - two threads needing to sync cache lines even though the bytes they are accessing don't overlap.
128 bit (16 byte) atomic operations need to be aligned on 128 bit boundaries or they will crash.
(if anyone sees something inaccurate here feel free to correct me)
- stcredzero 8y agoAlignment matter much more when using atomics. Someone should make a lockless library and call it, "Family." Most people will think it is a reference to the Fast and the Furious, but it would actually be a reference to Dune.