InterlockedDecrementRelease: Direct return vs temp variable
Summary In practice, there is no observable difference between storing the result of InterlockedDecrementRelease(&_count) in a local variable and returning it directly. Modern compilers, especially with optimisations enabled, generate identical machine code for both patterns on x86 and x64. The intermediate variable is a convenience for readability and debugging, not a synchronization optimisation. Root Cause … Read more