原文地址:http://stackoverflow.com/questions/680684/multi-cpu-multi-core-and-hyper-thread

Multi-CPU was the first version: You'd have one or more mainboards with one or more CPU chips on them. The main problem here was that the CPUs would have to expose some of their internal data to the other CPU so they wouldn't get in their way.

The next step was hyper-threading. One chip on the mainboard but it had some parts twice internally so it could execute two instructions at the same time.

The current development is multi-core. It's basically the original idea (several complete CPUs) but in a single chip. The advantage: Chip designers can easily put the additional wires for the sync signals into the chip (instead of having to route them out on a pin, then over the crowded mainboard and up into a second chip).

Super computers today are multi-cpu, multi-core: They have lots of mainboards with usually 2-4 CPUs on them, each CPU is multi-core and each has its own RAM.

[EDIT] You got that pretty much right. Just a few minor points:

  • Hyper-threading duplicates internal resources to reduce context switch time. Resources can be: Registers, arithmetic unit (so you can do several integer or even floating point calculations simultanously; or you can do an add and a multiply at the same time but not add and subtract), cache.

  • The main problem with multi-CPU is that code running on them will eventually access the RAM. There are N CPUs but only one bus to access the RAM. So you must have some hardware which makes sure that a) each CPU gets a fair amount of RAM access, b) that accesses to the same part of the RAM don't cause problems and c) most importantly, that CPU 2 will be notified when CPU 1 writes to some memory address which CPU 2 has in its internal cache. If that doesn't happen, CPU 2 will happily use the cached value, oblivious to the fact that it is outdated

    Just imagine you have tasks in a list and you want to spread them to all available CPUs. So CPU 1 will fetch the first element from the list and update the pointers. CPU 2 will do the same. For efficiency reasons, both CPUs will not only copy the few bytes into the cache but a whole "cache line" (whatever that may be). The assumption is that, when you read byte X, you'll soon read X+1, too.

    Now both CPUs have a copy of the memory in their cache. CPU 1 will then fetch the next item from the list. Without cache sync, it won't have noticed that CPU 2 has changed the list, too, and it will start to work on the same item as CPU 2.

    This is what effectively makes multi-CPU so complicated. Side effects of this can lead to a performance which is worse than what you'd get if the whole code ran only on a single CPU. The solution was multi-core: You can easily add as many wires as you need to synchronize the caches; you could even copy data from one cache to another (updating parts of a cache line without having to flush and reload it), etc. Or the cache logic could make sure that all CPUs get the same cache line when they access the same part of real RAM, simply blocking CPU 2 for a few nanoseconds until CPU 1 has made its changes.

[EDIT2] The main reason why multi-core is simpler than multi-cpu is that on a mainboard, you simply can't run all wires between the two chips which you'd need to make sync effective. Plus a signal only travels 30cm/ns tops (speed of light; in a wire, you usually have much less). And don't forget that, on a multi-layer mainboard, signals start to influence each other (crosstalk). We like to think that 0 is 0V and 1 is 5V but in reality, "0" is something between -0.5V (overdrive when dropping a line from 1->0) and .5V and "1" is anything above 0.8V.

If you have everything inside of a single chip, signals run much faster and you can have as many as you like (well, almost :). Also, signal crosstalk is much easier to control.

转载于:https://www.cnblogs.com/davidwang456/p/5219715.html

multi-CPU, multi-core and hyper-thread--转相关推荐

  1. Physical CPU、Logical CPU、Core、Thread、Socket

    Differences between physical CPU vs logical CPU vs Core vs Thread vs Socket 物理CPU (physical CPU). 逻辑 ...

  2. 物理/逻辑CPU、Core、Thread等概念

    物理/逻辑CPU.Core.Thread等概念 本篇为自己学习用,转载下.翻译的太好了. differences-between-physical-cpu-vs-logical-cpu-vs-core ...

  3. linux中物理cpu、逻辑cpu以及core、vcore

    linux中物理cpu.逻辑cpu以及core.vcore linux查看物理cpu: cat /proc/cpuinfo | grep 'physical id' | sort | wc -l li ...

  4. 多智能体强化学习Multi agent,多任务强化学习Multi task以及多智能体多任务强化学习Multi agent Multi task概述

    概述 在我之前的工作中,我自己总结了一些多智能体强化学习的算法和通俗的理解. 首先,关于题目中提到的这三个家伙,大家首先想到的就是强化学习的五件套: 状态:s 奖励:r 动作值:Q 状态值:V 策略: ...

  5. 【STL】rb_tree (multi)set (multi)map

    rb_tree rb_tree源码实现 G2.9版本的rb_tree源码 rb_tree底层实现红黑树,其示意图和代码如下: 4个需要注意的模板参数:Key,Value,KeyOfValue,Comp ...

  6. jstack: Java占用高CPU分析之- C2 Compiler Thread

    1. 现象 应用刚上线时发现Java进程占用了大量的CPU份额,但过了几分钟后会降下来(流量没变的情况下),因为已经做了负载均衡,于是拿一台实例重新部署代码上线来分析.具体分析步骤参考另外一篇文章&l ...

  7. HTT超线程技术,CPU,core,package,die的概念

    超线程技术 Intel超线程技术(Intel HT技术)是为了在多任务环境下执行多线程操作系统和应用程序代码或单线程应用程序时提高IA-32处理器的性能而开发的.超线程技术使单个物理处理器可以使用共享 ...

  8. linux查看cpu和core数量

    cpu和core的信息都在/proc/cpuinfo中: 1. 查物理CPU的个数 #cat /proc/cpuinfo |grep "physical id"|sort |uni ...

  9. Hyper Thread

     开机重启,按下F2,进入BIOS,选择Processor Configuration 找到Hyper Threading Tech,选择Enable 调整CPU 核数,找到Active Proc ...

  10. 4500m a8 amd_a8 4500m cpu排行榜_...al AMD A8 4500M laptop CPU Quad Core A8-4500M 1.9-amd(2)

    JPG,220x215,134KB,255_249 23HJ 通用A8 4500M 笔记本CPU-4500 cpu图片 价格 一淘网 JPG,217x220,164KB,250_253 a8-4500 ...

最新文章

  1. 征途猎魔mysql数据库_猎魔征途-猎魔征途官方首测版 - 超好玩
  2. 产品策略研究期的数据分析与挖掘
  3. 在visual studio中使用git版本系统(zz)
  4. 对接口编程:接口和抽象类
  5. Windows环境下Android Studio系列5—日志调试
  6. Identifiers in Java(Java标识符)
  7. 笨办法学C 练习45:一个简单的TCP/IP客户端
  8. leetcode619. 只出现一次的最大数字(SQL)
  9. fresco使用中圆角出现了黑边
  10. go json的key为数字怎么解析_golang向interface{}解析json时把所有的数字都当成float64...
  11. C#.NET 大型企业信息化系统集成快速开发平台 4.2 版本 - 员工离职管理
  12. php无限次执行函数,php – 防止多次执行JavaScript函数
  13. php如何修改xml中的数据,php如何修改xml内容
  14. 如何确定线程池核心数的最佳值?
  15. java_函数的内存加载过程
  16. CSS 实现 系统登录界面 (二)
  17. 吴恩达张潼接受WSJ采访:如何让AI像电力一样颠覆世界?
  18. 自然语言处理—文本分类综述/什么是文本分类
  19. 汽车照明全国产化电子元件推荐方案
  20. 计算机网络课程设计组建大型网吧局域网,计算机网络课程设计报告—组建大型网吧局域网.doc...

热门文章

  1. oracle define (hex 26),oracle 特殊字符轉義
  2. authenticationstring mysql_mysql5.7修改密码password字段变成了authentication_string字段
  3. php整蛊关机代码,整人代码大全
  4. C++中的final关键字
  5. SQLServer中的数据类型
  6. QT Creator介绍
  7. 配置phoenix连接hbase_Phoenix4.14不读取hbase配置文件-问答-阿里云开发者社区-阿里云...
  8. linux 内核 死锁 检查,一种linux内核自旋锁死锁检测报告系统和方法与流程
  9. win10 jenkins svn android studio 自动化打包教程 以及一些问题的解决办法
  10. c++ string 另类写法