Quantcast
Channel: Why does using the same cache-line from multiple threads not cause serious slowdown? - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Image may be NSFW.
Clik here to view.

Answer by BeeOnRope for Why does using the same cache-line from multiple...

What you are seeing is basically the effect of the store buffer combined with store-to-load forwarding allowing each core to work mostly independently, despite sharing a cache line. As we will see...

View Article


Answer by mksteve for Why does using the same cache-line from multiple...

The atomic version has to ensure that some other thread will be able to read the result in a sequentially consistent fashion. So there are fences for each write.The volatile version does not make any...

View Article


Why does using the same cache-line from multiple threads not cause serious...

Look at this snippet:#include <atomic>#include <thread>typedef volatile unsigned char Type;// typedef std::atomic_uchar Type;void fn(Type *p) { for (int i=0; i<500000000; i++) { (*p)++;...

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>