A partial update occurs when one thread changes related data while another thread reads between those changes, observing a mixture of old and new values. The inconsistency can be obvious with two assignments, but a single assignment may hide multiple memory operations. section 7.1
C# struct copies can compile into member-by-member writes, and wide values such as decimal can span multiple memory operations. Even long assignments depend on the process’s bitness, so apparent single-value updates are not universally safe. section 7.1 section 7.1
Protect the complete operation
Use one lock for both writing and reading related fields. SetXY updates _x and _y under the same lock, while GetXY reads both under that lock, preventing an observer from seeing an intermediate pair.
Locking individual fields or successive operations is insufficient when the values form one logical operation. Hold the lock across the entire invariant-preserving operation, while avoiding unnecessarily long critical sections. section 7.4
