Comparing the performance of atomic, spinlock and mutex I was curious in benchmark of different synchronization mechanisms: atomic, spinlock, mutex. Without synchronization #include <future> #include <iostream> volatile int value = 0; int loop(bool inc, int limit) { std::cout << "Started " << inc << " " << limit << std::endl; for (int i = 0; i < limit; ++i) { if (inc) { ++value; } else { --value;