Search code examples
c#multithreadingunsignedinterlocked

Unsigned Interlocked Reads


What is the reasoning behind Interlocked.Read() only being defined for Int64 and not for UInt64? I wouldn't have thought there was any difference between the two types.


Solution

  • The Interlocked class is defined in mscorlib which is CLS-Compliant and UInt32 and UInt64 are, for better or for worse, not CLS-Compliant.

    As for why they are not CLS-Compliant, see this SO article: