Hello,
I'm using atomic operations on counters, and I care about performance. I know that on the 64-bit platform incrementing a long
can be done in one shot, instead it requires two instructions in 32-bit platforms
I have such a code fragment
#if X64
using COUNTER_TYPE = System.Int64;
#else
using COUNTER_TYPE = System.Int32;
#endif
But I define no X64 constant in my project's configuration. I wonder if there is a way to determine via #if statements if we are compiling for the x64 or not. When I implement a circular queue, I want to force its size up to 4 billions elements when running on x86, but I may appreciate unlocking its size to long.MaxValue
when on x64. I know that on modern processors one or two instructions don't really care, but it's still my curiosity to know if I can detect the configuration via code without redefining an x64 profile with such constant specified.
Thank you.