Wow, guess i need to look more into my code then. Thanks for sharing.
Only issue i see is that i eventually plan to migrate away from using mscrt using the guide you actually posted (epic thanks for that by the way). Wouldn't that make them not work?
Also just as an overall question/observation.
_Read/WriteBarrier is deprecated.
certain explicit GCC calls such as _sync_synchronize (i know Casey said x86/x64 do not require HW barriers, but for other cases such as ARM) are also deprecated.
For each search that tells me asm volatile("" :: "memory") is deprecated, i find another one that says it is not.
Everything i find is saying to use std::atomic rather than any of these, which means C++ std lib.
Are programmers who just use straight C (or trying to avoid C++ std lib) just out of luck? Or will these 'deprecated' methods always be supported, because as i mentioned in the initial post my worst fear is making everything work with one of these deprecated methods and in the future discover that future compilers are no longer supporting them.
P.S Im assuming that since _Read/WriteBarrier rely on the mscrt, that asm volatile/_sync_synchronize must rely on some crt library. Is this true.
P.S.S The macro in the windows platform definitions. Pretty sure i might be doing something wrong. I have very little experience in lockless multithreading.
| #define RELEASE_FENCE() asm volatile("" ::: "memory") __sync_synchronize();
|