Switch to Bing in English
Copilot
Your everyday AI companion
About 31,700,000 results
    Upvotes52Top Answeredited Sep 5, 2023 at 7:08

    As mentioned in a comment, there's a difference between a compiler barrier and a processor barrier. volatile and memory in the asm statement act as a compiler barrier, but the processor is still free to reorder instructions.

    Processor barriers are special instructions that must be explicitly given, e.g. rdtscp, cpuid, memory fence instructions (mfence, lfence, ...) etc. lfence is also an execution barrier (on Intel, and more recently AMD), so it's interesting in combination with rdtsc (which isn't a memory operation, and is only ordered by *fen...

    Content Under CC-BY-SA license
    Was this helpful?
  1. __rdtscp | Microsoft Learn

  2. RDTSCP — Read Time-Stamp Counter and Processor ID

  3. __rdtscp | Microsoft Learn

  4. __rdtsc | Microsoft Learn

  5. RDTSC — Read Time-Stamp Counter - felixcloutier.com

  6. GitHub - xuwd1/rdtsc-notes: notes and example codes on ...

  7. GitHub - fordsfords/rdtsc: Demo of rdtsc in c

  8. gabrieleara/librdtsc - GitHub

  9. RDTSCP—Read Time-Stamp Counter and Processor ID ...

  10. Some results have been removed
By using this site you agree to the use of cookies for analytics, personalized content, and ads.Learn more about third party cookies|Microsoft Privacy Policy