Consider that I have a std::atomic<long> variable, and two threads that both write to the variable. I have a multicore machine so these two threads run truly concurrently.
Assuming that the writes happen at precisely the same time (if that is possible), what mechanism exists to ensure that the results of the two writes are not interleaved in any way?
Aucun commentaire:
Enregistrer un commentaire