Details, Fiction and wallet atomic
It's Considerably more challenging to unintentionally violate threadsafety when calling getAndIncrement() than when returning i++ and remembering (or not) to accumulate the right set of monitors beforehand.JoshJosh 17011 silver badge44 bronze badges one Of course, many non-x86 ISAs use LL/SC. The details of how they regulate to monitor a cache line