Is there a practical likelihood that the values ever obtained by T1 will differ from 0 or 5 with modern computer architectures and compilers? What about other primitive types?
Of course, there is no guarantee that all data will be written and read in an atomic manner. In practice, you can get the reading that happened during the partial recording. What can be interrupted, and when it happens, depends on several variables. Thus, in practice, the results can easily vary depending on the size and alignment of the types. Naturally, this difference can also be introduced, as your program moves from platform to platform and changes as ABI. In addition, the observed results may change as optimizations are added and other types / abstractions are introduced. The compiler can optimize most of your program; possibly completely, depending on the size of the instance (another variable that is not considered in the OP).
In addition to optimizers, compilers, and specific hardware pipelines: the kernel may even influence the way this memory area is processed. Does your program support Warranty , where is the memory of each object? Probably no. The memory of your object may exist on separate pages of virtual memory - what steps does your program take to ensure that memory is read and written consistently for all platforms / cores? (no, apparently)
In short: if you cannot play by the rules defined by the abstract machine, you should not use the interface of the specified abstract machine (for example, you should just understand and use the assembly if the specification of the C ++ abstract machine is really inadequate for your need - very unlikely).
All of the assembler code that I have studied so far has consisted of using 32-bit reads and writes in memory, which seems to preserve the integrity of the operation.
This is a very shallow definition of "integrity." All you have is (pseudo) consistent consistency. In addition, the compiler needs to behave as if in a scenario that is far from strict sequence. Shallow waiting means that even if the compiler did not actually optimize the breakdown and read and write in accordance with some ideal or intention, the result would be practically useless - your program would observe changes that are usually “long” after it appears.
The topic remains irrelevant, given what specifically you can Warranty .