Hacker News new | past | comments | ask | show | jobs | submit login

Yes, it's quite possible to cause tearing in C#. It does not cause undefined behavior, but it can, for example, break invariants (supposedly enforced by privacy) in large enough structs.

See this example where I break encapsulation in a struct by abusing a race condition:

https://github.com/VictorGavrish/MultiThreading/blob/master/...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: