Process

ProcessThread:

Process and ProcessThread objects have a ProcessorAffinity property of IntPtr type that can be directly manipulated to read/change affinity for up to 64 processors:


using System.Diagnostics;
...
Process Proc = Process.GetCurrentProcess();
long AffinityMask = (long)Proc.ProcessorAffinity;
AffinityMask &= 0x000F; // use only any of the first 4 available processors
Proc.ProcessorAffinity = (IntPtr)AffinityMask; ProcessThread Thread = Proc.Threads[0];
AffinityMask = 0x0002; // use only the second processor, despite availability
Thread.ProcessorAffinity = (IntPtr)AffinityMask;
...

You can also use the thread's IdealProcessor property to allow the scheduler to prefer running the thread on a specified processor (without guarantee).

Thread

最新文章

  1. Linux(Centos)之安装Java JDK及注意事项
  2. java分享第七天-03(递归打印文件目录的树状结构)
  3. ssh/openssh
  4. 算法与数据结构(2)--英雄会第三届在线编程大赛:几个bing
  5. jQuery Form 表单提交插件-----formSerialize,fieldSerialize,fieldValue,resetForm,clearForm,clearFields的 应用
  6. 【NOIP2015】提高day2解题报告
  7. 关于PowerDesigner
  8. Bzoj 3781: 小B的询问 莫队,分块,暴力
  9. Android事件的分发机制
  10. php mysql_insert_id() 获取为空
  11. Web Api帮助页面或用户手册
  12. 有关信息ACM/ICPC竞争环境GCC/G++叠插件研究记录的扩展
  13. java根据HashMap中的值将其元素排序
  14. Java的static和final关键字的用法
  15. OpenGL shader渲染贴图
  16. Qt 自定义按钮
  17. nginx命令启动及选项
  18. 设计模式-简单工厂Coding+jdk源码解析
  19. poj2352树状数组解决偏序问题
  20. C++学习二继承

热门文章

  1. string截断
  2. Android自动化框架 模拟操作 模拟测试
  3. java操作Excel之POI(5)利用POI实现使用模板批量导出数据
  4. [转]连连看游戏 C#
  5. 原创)CentOS6.4下安装xampp(一定要在linux上下载)
  6. web项目除了业务还需要关注的点
  7. 2018ICPC网络赛(徐州站)A题题解
  8. PHP学习方法总结
  9. 关于open_cursors和session_cached_cursors的参数值(转)
  10. CSS 3 学习笔记