I am currently writing code for tcl microbenchmarking support for which I am using perfinsp C API on the windows platform. I want to get some information about whether perfinsp Initcounting() and stopcounting() functions take care of serializing the execution of instructions. If they don't I will try using instructions like 'CPUID' to enforce it.

The other ways to enforce serialization include wrmsr, cpuid etc. assembly instructions.

Please help.