#include using namespace std; std::atomic counter(0); void increment() { for (int i = 0; i < 100000; ++i) { counter.store(counter.load() + 1); } } int main() { std::thread t1(increment); std::thread t2(increment); t1.join(); t2.join(); std::cout << "Counter: " << counter.load() << std::endl; return 0; } 为啥最后打印类似100475,100425之类的值? 我看写这个的人说会打印200000.