Obtaining thread Core affinity in C++ 11 through pthreads

后端 未结 2 1502
庸人自扰
庸人自扰 2021-02-06 04:44

I\'m trying to set core affinity (Thread #1 goes on first core, Thread #2 goes on second core, ...) while using std::thread in C++ 11.

I\'ve already searched around vari

2条回答
  •  春和景丽
    2021-02-06 05:30

    You can get the native handle for the thread with the native_handle function.

    The example in the linked reference even uses this to call pthread functions.

提交回复
热议问题