perf-book icon indicating copy to clipboard operation
perf-book copied to clipboard

TSC is not per CPU but per CPU core

Open ujos opened this issue 1 year ago • 1 comments

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.

ujos avatar Jan 01 '25 20:01 ujos

Even on Windows if you call QueryPerformanceCounterfunction from the multiple threads you may get negative duration value

ujos avatar Jan 01 '25 20:01 ujos