Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is that generally done? Platform specific libraries? Utilities that ask the OS to pin a program to a node?


In Linux you can use numactl command to pin a process.


Windows has a NUMA API[1] to help with these things. For pinning a thread you can for example use the SetThreadSelectedCpuSetMasks call[2] from what I can gather.

[1]: https://docs.microsoft.com/en-us/windows/win32/procthread/nu...

[2]: https://docs.microsoft.com/en-us/windows/win32/api/processth...


libnuma probably does the job.

https://github.com/numactl/numactl


If you want to do set thread-core affinity in a cross-platform way, hwloc is a good approach: https://www.open-mpi.org/projects/hwloc/doc/v2.7.0/a00166.ph...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: