easy_profiler icon indicating copy to clipboard operation
easy_profiler copied to clipboard

Thread affinity

Open minh0722 opened this issue 6 years ago • 2 comments

Is there a way to know which core a thread is bounded to?

minh0722 avatar Sep 03 '17 14:09 minh0722

Not in this version. That would take quite a bit more effort.

rationalcoder avatar Sep 03 '17 17:09 rationalcoder

I have performed some investigation and realized that this is not as simple.

We could ask cpu id for each block when it starts, but this is not very reliable information because active cpu could change at any context switch. And additionally getting cpu id could be somewhat heavy operation (unconfirmed information).

Also it seems impossible to get cpu id for particular thread from another thread (when parsing context switch events in Windows build). Considering all the above, it seems that we should create a separate utility which would parse system tracing events (like a utility for gathering context switch events for Unix build).

So anyone who has more information on how to do this (for Windows, Linux, MacOS), please share your knowledge! :)

cas4ey avatar Feb 02 '18 08:02 cas4ey