"how to increment (add value to) decimal in a thread-safe way?" Code Answer

2

using lock is not overkill. it is required.

structure types like system.decimal are never atomic, it also doesn't fit the native cpu word size. which is why interlocked doesn't have an overload for it either.

By Darren Harrison on March 1 2022

Answers related to “how to increment (add value to) decimal in a thread-safe way?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.