Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSC is not per CPU but per CPU core #83

Open
ujos opened this issue Jan 1, 2025 · 1 comment
Open

TSC is not per CPU but per CPU core #83

ujos opened this issue Jan 1, 2025 · 1 comment

Comments

@ujos
Copy link

ujos commented Jan 1, 2025

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
Copy link
Author

ujos commented Jan 1, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant