What is the way to obtain a thread safe counter in C# with best possible performance?
This is as simple as it gets:
public static long GetNextValue()
This would be simpler:
return Interlocked.Increment(ref COUNTER);
MSDN Interlocked.Increment