2 ms·
In principle this is no different from the situation with long and double in Java, for which atomicity is not guaranteed, and word tearing can occur. It is stil
by layer8 3y ago
In principle this is no different from the situation with long and double in Java, for which atomicity is not guaranteed, and word tearing can occur. It is still considered defined behavior, in the sense that you will see some combination of actually written values, and not get nasal demons.
- dzaima 3y agoAnd so Java effectively mandates at least max(32, size of Object)-bit atomic writes, while C can trivially run on 16-bit systems. I don't know if anyone's running multi-threaded software on such, but having a completely arbitrary boundary (from the point-of-view of a programmer wanting to store an integer) for what does and doesn't behave sanely is far from nice.