``` + if (!(frequency.QuadPart = ReadAcquire64( &freq_cache ))) + { + QueryPerformanceFrequency( &frequency ); + WriteRelease64( &freq_cache, frequency.QuadPart ); + } QueryPerformanceCounter( &counter ); ```
Why do we need acquire/release here? Where is the barrier pair?
``` -static inline int g_atomic_int_get( int *ptr ) { return ReadAcquire( (LONG *)ptr ); } +static inline int g_atomic_int_get( int *ptr ) { int value = ReadNoFence( (LONG *)ptr ); MemoryBarrier(); return value; } ```
Why?