After reading a bit more about the volatile keyword in a couple of places, it seems that we need to mark any data we have in shared memory as volatile to prevent the compiler from making an optimization it shouldn't make. We'd effectively be marking our data as being allowed to be changed outside of the current program or in ways that the compiler can't determine statically, if I understand correctly. This should be a pretty small addition.
After reading a bit more about the volatile keyword in a couple of places, it seems that we need to mark any data we have in shared memory as
volatileto prevent the compiler from making an optimization it shouldn't make. We'd effectively be marking our data as being allowed to be changed outside of the current program or in ways that the compiler can't determine statically, if I understand correctly. This should be a pretty small addition.