多线程的程序在多核CPU与单核CPU运行效率有何不同
2012-04-30 14:24
337 查看
文章出处: http://topic.csdn.net/u/20080429/17/689d07f9-1199-4c8f-b7b7-60b24609270f.html
Depends on how the OS schedule threads to CPUs, and how applications set their threads' processor affinity
In windows, the operation system does the allocation for you based on cpu usage. You can set the affinity but, it will not determine which processor you run on. On the XBox 360, the affinity is needed otherwise the 360 will not allocate your thread to
a seperate processor at all.
In Mac, threads with default affinity policy will be scheduled freely on any processor. These threads will be preferentially migrated to run on an idle processor. Threads with affinity tags will tend to remain in place.
In Linux, you can force the thread to migrate on the other cpu, by calling *_setaffinity() with different mask.
Depends on how the OS schedule threads to CPUs, and how applications set their threads' processor affinity
In windows, the operation system does the allocation for you based on cpu usage. You can set the affinity but, it will not determine which processor you run on. On the XBox 360, the affinity is needed otherwise the 360 will not allocate your thread to
a seperate processor at all.
In Mac, threads with default affinity policy will be scheduled freely on any processor. These threads will be preferentially migrated to run on an idle processor. Threads with affinity tags will tend to remain in place.
In Linux, you can force the thread to migrate on the other cpu, by calling *_setaffinity() with different mask.
相关文章推荐
- Java多核cpu多线程运行效率分析
- 多核cpu电脑运行多线程程序的问题
- 多线程程序在多核和单核上运行的不同
- 多线程——让多核CPU单核运行
- 一个程序来比较cuda/c在GPU/CPU的运行效率
- 一个程序来比较cuda/c在GPU/CPU的运行效率
- 将网卡与特定的CPU绑定,提高程序的运行效率
- 对于多线程程序,单核cpu与多核cpu是怎么工作的
- Kivy A to Z -- 通过绑定进程运行CPU提高Python程序在多核CPU平台上的性能
- 为golang程序使用pprof远程查看httpserver运行堆栈,cpu耗时等信息
- 【转载】.Net的程序运行效率比VC++低?不!翻译自国外的一篇文章
- 使用C/C++设计多线程程序监控Lu脚本运行
- 提高程序运行效率的简单方法
- java多线程不单单只是提高程序的执行效率
- 查看正在运行的程序对cpu的占有率
- ★实验10-2 1. 编写程序测试sigaction()函数。 2. sa_flags 设置为以下标志时,程序的行为有何不同。 对比程序运行情况予以说明。 SA_SIGINFO SA_NOCLDST
- 使用zookeeper解决程序在不同集群之间运行的高可用
- 裸机程序常识2 CPU运行的7种模式 system and user ,supervisior ,Abort ,IRQ,FIQ , undefined
- java多线程对于多核cpu来说输出无先后顺序
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)