【问题标题】:ISPC - can I limit the number of CPU threads to 1?ISPC - 我可以将 CPU 线程数限制为 1 吗?
【发布时间】:2014-05-28 09:04:31
【问题描述】:

我在 Windows 上使用基于 ISPC 的程序,我想知道是否有任何方法可以将 CPU 线程数限制为 1,因为我必须运行一些实验。

【问题讨论】:

    标签: c++ windows multithreading ispc


    【解决方案1】:

    您可以使用SetProcessAffinityMask (msdn link) API 函数:

    BOOL SetProcessAffinityMask(
      HANDLE hProcess,
      DWORD_PTR dwProcessAffinityMask
    );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-16
      • 2016-02-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多