I am doing a little experiment with some code and I would like to read the following value atomically:
“LoopIndex[BlockIndex]” should be read atomically.
I am not sure how to do that, should I wrap it in AtomicCAS.
My CAS-skills are a bit rusty, an example how to solve it for the problem below would appreciated !
while (LoopIndex[BlockIndex] < LoopCount)