Unsigned Interlocked Reads
-
14-10-2019 - |
Question
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:
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow