Quick question… Suppose I have a C# struct that contains a single reference member. Are assignments of this struct atomic in .NET? For Example:
struct ReadOnlyList<T>
{
private List<T> list;
// other random functionality
};
I know that plain old reference assignments are atomic, just curious if wrapping the whole thing up in a struct makes any difference…
Thanks
So atomicity of assignment of a structure with the only reference-type member is implementation defined, and you should not rely on it.