I have a size_t variable which is updated by a std::thread and read by another std::thread.
I know that I can mutex protect the reads and writes. But, would it be the same or would it be beneficial if I make the size_t as std::atomic<size_t>?
Aucun commentaire:
Enregistrer un commentaire