core_affinity_rs
core_affinity_rs copied to clipboard
Is it possible to get core id in which a thread is running?
It seems we can implement it on linux with sched_getcpu
.
This link gives another way to get cpu id on x86 platform, which can cover windows on x86.
Current implementation for linux and windows can be found at repo. I don't have any idea on how to implement on Mac, nor do I have a device for testing. Maybe we can reference to this answer.
Current implementation of windows use GetCurrentProcessorNumber API. Seems it is not applicable for more than 64 logical processors.