perf-book
perf-book copied to clipboard
TSC is not per CPU but per CPU core
In the book there is following sentence:
Page 33 Every CPU has its own TSC
Based on my experience actually every CPU core has its own TSC. In order to get reliable duration one should bind his/her thread to the CPU core. Otherwise the duration may not be accurate.
Even on Windows if you call QueryPerformanceCounterfunction from the multiple threads you may get negative duration value