Set CPU mask on thread level
Hi! All: Not sure if this has been asked before.
Is it possible to set CPU mask on thread level? Essentially, something like sched_setaffinity(),
but not on process level.
I am asking this question because, I need a high-precision performance measurement tool. Thinking
of using TSC, but TSC is not synced among different CPUs, and I certainly don't want to limit my
entire process into just one CPU. If I could just fix one of my thread into one specific CPU that
would solve the issue.
Any suggestions will be great! Thanks!
|