KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
On the following code: std::atomic<int> myint; //Shared variable //(...) if( --myint == 0) { //Code block B } Is it possible that more than one thread access the block I named "Code Block B"? Please consider that overflow will not happen, that the 'if' is being executed concurrently by more than one thread, that the only modification to myint in the whole program is the --myint inside the if and that myint is initialized with a positive value.
Tags (comma-separated)
Save Edits
Cancel