作者guanrulee (Cobra)
看板C_and_CPP
標題[問題] pthread可以自己分配thread要到哪個CPU上執行嗎?
時間Tue Sep 27 10:06:26 2011
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
linux
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
pthread
問題(Question):
有辦法自己指定thread要到哪個cpu上執行嗎?
或是可以有get cpu id等function知道cpu的id嗎?
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.225.128
推 tropical72:SetThreadAffinityMask 09/27 10:20
→ tropical72:抱歉,誤會一場,上面 api 是在 win, linux 上要再查一下 09/27 10:22
推 final01:tool "schedutils"也可順便參考它的 code 09/27 15:52
→ firejox:請愛用man page好嗎... 09/27 20:03
→ firejox:man pthreads ... 09/27 20:03
推 Rukawa31:sched_setaffinity() 09/29 16:18