I just wanted to know about the memory consistency model for UAVs.
Let us say I have 2 threads : Thread 1 and Thread 2.
Question 1: Thread 1 reads the value "V1" from address X in UAV, then writes some other value "V2" to address X. If thread 1 reads the same address X again, is there a guarantee that value V2 will be read by thread 1?
Question 2: Thread 2 does not write anything. But let's assume thread 2 attempts to read the address X. Lets assume V2 was 8 bytes. Can it happen that somehow thread 2 will end up reading 4 bytes of V1 and 4 bytes of V2? So the question is, if I try to write 2 components (i.e. 8 bytes), is the write operation done atomically so that all 8 bytes are updated?