SetThreadAffinityMask 把线程限定在CPU上运行
摘要:
很简单的函数:比如把当前线程限制在CPU0(第一个processor)上运行:SetThreadAffinityMask(GetCurrentThread(), 1)第0位是1又比如要把当前线程限制在CPU1,CPU2这两个上运行:SetThreadAffinityMask(GetCurrentThread(), 6)第1,2位同时为1If the function succeeds, the return value is the thread's previous affinity mask.If the function fails, the return value is ze 阅读全文
posted @ 2012-10-07 09:14 hgy413 阅读(661) 评论(0) 推荐(0) 编辑