mardi 23 février 2016

Is atomicity preserved between std::atomic operations?

I have defined the following:

std::atomic_int m_decoding_thread_count;

Can it be ensured that the following will be atomic? or might my thread loose the processor to another thread in between of the two operations?

int thread_id = (++m_decoding_thread_count).load();

Aucun commentaire:

Enregistrer un commentaire