Quantcast
Channel: atomic operations take longer than locking (without contention) - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Shachar Shemesh for atomic operations take longer than locking...

The problems are with the benchmark program.The first is that std::atomic was not declared static, causing a new one to be used at each iteration. The second problem is that the program was not...

View Article



atomic operations take longer than locking (without contention)

I'm trying to measure the overhead of the various synchronization options when there is no contention. I use the following program:#include <atomic>#include <chrono>#include...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images