Concurrent writes to same variable.

Hi,

I wanted to know if the behavior of a race condition is undefined even if multiple threads are writing the same value to a variable. e.g.
GPU_kernel(int *flag)

{

     if(some condition) 

         *flag=1;

}

No thread in the kernel will set any other value. I wanted to do this without atomic operations just to check if any of the threads satisfy a condition. Thanks.

so long as all threads are writing the same value, you’re guaranteed to see the correct value.