NUMA Get Current Node/Core

前端 未结 3 1934
有刺的猬
有刺的猬 2020-12-30 15:17

I\'m using libnuma on Linux. My threads should be aware of the node/core they\'re running on. Is it possible to get the current threads\'s node/core somehow? I\'ve been thro

3条回答
  •  借酒劲吻你
    2020-12-30 15:48

    You need to use getcpu() system call. As man page says:

    determine CPU and NUMA node on which the calling thread is running

    So, this should serve your purpose. Needs to include , with kernel version greater than 2.6.19 and for x86_64, i386 arch.

提交回复
热议问题