如何计算多核处理器的处理器速度?

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,它是一个由Q&a网站组成的社区驱动分组。...

如何计算多核处理器的处理器速度?The advent of economical c***umer grade multi-core processors raises the question for many users: how do you effectively calculate the real speed of a multi-core system? Is a 4-core 3Ghz system really 12Ghz? Read on as we investigate.

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,它是一个由Q&a网站组成的社区驱动分组。

问题

超级用户读者nreligh很好奇如何计算多核系统的处理器速度:

Is it correct to say, for example, that a processor with four cores each running at 3GHz is in fact a processor running at 12GHz?

I once got into a “Mac vs. PC” argument (which by the way is NOT the focus of this topic… that was back in middle school) with an acquaintance who insisted that Macs were only being advertised as 1Ghz machines because they were dual-processor G4s each running at 500MHz.

At the time I knew this to be hogwash for reas*** I think are apparent to most people, but I just saw a comment on this website to the effect of “6 cores x 0.2GHz = 1.2Ghz” and that got me thinking again about whether there’s a real answer to this.

So, this is a more-or-less philosophical/deep technical question about the semantics of clock speed calculation. I see two possibilities:

  1. Each core is in fact doing x calculati*** per second, thus the total number of calculati*** is x(cores).
  2. Clock speed is rather a count of the number of cycles the processor goes through in the space of a second, so as long as all cores are running at the same speed, the speed of each clock cycle stays the same no matter how many cores exist. In other words, Hz = (core1Hz+core2Hz+…)/cores.

那么,什么是表示总时钟速度的合适方法呢?更重要的是,在多核系统上使用单核速度术语是否可能?

答案

超级用户贡献者Mokubai帮助解决问题。他写道:

The main reason why a quad-core 3GHz processor is never as fast as a 12GHz single core is to do with how the task running on that processor works, i.e. single-threaded or multi-threaded. Amdahl’s Law is important when c***idering the types of tasks you are running.

If you have a task that is inherently linear and has to be done precisely step-by-step such as (a grossly simple program)

10: a = a + 1 20: goto 10

Then the task depends highly on the result of the previous pass and cannot run multiple copies of itself without corrupting the value of 'a' as each copy would be getting the value of 'a' at different times and writing it back differently. This restricts the task to a single thread and thus the task can only ever be running on a single core at any given time, if it were to run on multiple cores then the synchronisation corruption would happen. This limits it to 1/2 of the cpu power of a dual core system, or 1/4 in a quad core system.

Now take a task such as:

10: a = a + 1 20: b = b + 1 30: c = c + 1 40: d = d + 1 50: goto 10

All of these lines are independent and could be split into 4 separate programs like the first and run at the same time, each one able to make effective use of the full power of one of the cores without any synchronisation problem, this is where Amdahl’s Law comes into it.

So if you have a single threaded application doing brute force calculati*** the single 12GHz processor would win hands down, if you can somehow make the task split into separate parts and multi-threaded then the 4 cores could come close to, but not quite reach, the same performance, as per Amdahl’s Law.

The main thing that a multi CPU system gives you is resp***iveness. On a single core machine that is working hard the system can seem sluggish as most of the time could be being used by one task and the other tasks only run in short bursts in between the larger task, resulting in a system that seems sluggish or juddery. On a multi-core system the heavy task gets one core and all the other tasks play on the other cores, doing their jobs quickly and efficiently.

The argument of “6 cores x 0.2GHz = 1.2Ghz” is rubbish in every situation except where tasks are perfectly parallel and independant. There are a good number of tasks that are highly parallel, but they still require some form of synchr***ation. Handbrake is a video trancoder that is very good at using all the CPUs available but it does require a core process to keep the other threads filled with data and collect the data that they are done with.

  1. Each core is in fact doing x calculati*** per second, thus the total number of calculati*** is x(cores).

Each core is capable of doing x calculati*** per second, assuming the workload is suitable parallel, on a linear program all you have is 1 core.

  1. Clock speed is rather a count of the number of cycles the processor goes through in the space of a second, so as long as all cores are running at the same speed, the speed of each clock cycle stays the same no matter how many cores exist. In other words, Hz = (core1Hz+core2Hz+…)/cores.

I think it is a fallacy to think that 4 x 3GHz = 12GHz, granted the maths works, but you’re comparing apples to oranges and the sums just aren’t right, GHz can’t simply be added together for every situation. I would change it to 4 x 3GHz = 4 x 3GHz.

有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-12 04:49
  • 阅读 ( 201 )
  • 分类:互联网

你可能感兴趣的文章

核心(core)和处理器(processor)的区别

核心与处理器 若你们不懂计算机,处理器和内核之间的区别可能是一个令人费解的话题。处理器或CPU就像计算机系统的大脑。它负责所有的核心功能,如算术、逻辑和控制操作。传统处理器(如奔腾处理器)内部只有一个内...

  • 发布于 2020-10-26 19:06
  • 阅读 ( 1198 )

什么是cpu?它做什么?

... 什么是中央处理器(a cpu)? ...

  • 发布于 2021-03-17 18:33
  • 阅读 ( 122 )

更快、更薄、更便宜:库米定律是新摩尔定律吗?

...年翻一番,每年的**成本将降低20%到30%。英特尔的第一个处理器于1971年发布,拥有2250个晶体管和12平方毫米的面积。今天的CPU每平方毫米容纳数亿个晶体管。 ...

  • 发布于 2021-03-28 23:53
  • 阅读 ( 413 )

amd与英特尔:什么是最好的游戏cpu?

...为你的新游戏机选择什么CPU?让我们看看AMD与英特尔游戏处理器。 ...

  • 发布于 2021-03-30 01:00
  • 阅读 ( 400 )

cpu基础知识:多cpu、内核和超线程

基本上,计算机中的中央处理器(CPU)在运行程序时进行计算工作。但是现代的cpu提供了多核和超线程等特性。有些PC甚至使用多个CPU。我们是来帮忙解决这一切的。 相关:为什么不能用CPU时钟速度来比较计算机性能 在比较性...

  • 发布于 2021-04-07 16:27
  • 阅读 ( 129 )

如何计算多核处理器的处理器速度?

...。 问题 超级用户读者nreligh很好奇如何计算多核系统的处理器速度: Is it correct to say, for example, that a processor with four cores each running at 3GHz is in fact a processor running at 12GHz? I once got into a “Mac vs. PC” argument (which by the way is NOT the focu...

  • 发布于 2021-04-12 04:49
  • 阅读 ( 201 )

为什么要1000核处理器?

...过去十年的大部分计算都是将这些额外的晶体管塞进多核处理器和gpu中。你看,gpu之所以快是因为它们是大规模并行的(GeForce gtx1080有2560个“内核”,运行频率仅为1600–1700MHz),程序员创建的软件可以很容易地分解成小块,并...

  • 发布于 2021-05-05 21:04
  • 阅读 ( 134 )

amd采用新款ryzen笔记本电脑处理器与英特尔展开较量

...地位提出了可信的挑战,从Threadripper系列这样的高端多核处理器到廉价的Ryzen 3。 但现在AMD将目光投向了更高的领域,笔记本电脑可以说是电脑领域最重要的部分,而英特尔的核心i3、i5和i7芯片系列长期以来几乎没有...

  • 发布于 2021-06-21 22:19
  • 阅读 ( 161 )

四核(quad core)和双核(dual core)的区别

...多,后来又转移到速度最高的人身上。鉴于目前的技术,处理器速度已经达到极限,这场战争已经从更快的处理器转向更多的处理器。为了追求更快更好的计算能力,这两家最大的微处理器**商在一个封装中构建了更多的内核。...

  • 发布于 2021-06-22 11:33
  • 阅读 ( 188 )

中央处理器(cpu)和核心(core)的区别

...,而Core是CPU内部接收和执行指令的执行单元。 CPU或中央处理器是计算机的大脑。它处理计算机正常运行所需的所有指令。一个CPU可以包含一个或多个内核。核心是CPU中执行实际执行的单元。大多数现代计算机都是多核处理器。...

  • 发布于 2021-06-30 21:10
  • 阅读 ( 697 )
nyj48002
nyj48002

0 篇文章

相关推荐