(This may be a general question for atomic increment/decrement but I have encountered the situation in the realm of shared_ptrs
)
Does a shared_ptr
encounter two cache line misses/accesses- when the atomic reference counter is incremented and decremented?
I did find this:
but it doesn't seem to be overly conclusive....
UPDATE:
If I run a loop millions of times, incrementing an atomic variable I get a L1 cache miss rate of 0.2. If I do the same with a non-atomic int I get 0 L1 cache miss rate.....
The test would imply the L1 cache line is being evicted.