如何讓進程/子函數綁定在固定的cpu上執行?

    在某些場合,咱們想知道本身的進程到底執行在哪一個cpu上或者想指定某一個進程在指定的cpu上執行(尤爲是在多核場合),基本方法以下:html 一、頭文件函數 #define __USE_GNU #include <unistd.h> #include <sched.h> #include <pthread.h> #include <sys/syscall.h> 二、源碼code s
相關文章
相關標籤/搜索