# 多核处理器

**多核处理器**是一种单个集成电路，其中包含两个或多个独立的处理单元，称为核心，每个核心都能读取并执行程序指令，从而使多条指令流在一片芯片上并行运行。<sup>[1](https://sei.cmu.edu/blog/multicore-processing/)</sup> 这些核心可以是相同的（同构或对称），也可以是不同设计的（异构或非对称），它们共享片上资源，如缓存、互连和内存控制器。<sup>[1](https://sei.cmu.edu/blog/multicore-processing/)</sup><sup> • </sup><sup>[2](https://technav.ieee.org/topic/multicore-processing/)</sup> 多核处理处于计算机体系结构、操作系统和编程语言的交汇点：硬件提供核心，操作系统调度器将就绪线程映射到核心上，而软件必须暴露出足够的并行性，才能让额外的核心得到利用。<sup>[2](https://technav.ieee.org/topic/multicore-processing/)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 一种包含多个核心处理单元的单个集成电路（片上多处理器，CMP）；四核处理器有四个核心。<sup>[1](https://sei.cmu.edu/blog/multicore-processing/)</sup> |
| 加速上限 | 阿姆达尔定律：\( S = 1 / (1 - P + P/n) \)，其中 \( P \) 是可并行化的比例，\( n \) 是处理器数量；90% 可并行化的代码无论核心数多少，加速比上限都是 10 倍。<sup>[3](https://rc.dartmouth.edu/hpc-cookbook/fundamentals/parallel-computing/)</sup><sup> • </sup><sup>[2](https://technav.ieee.org/topic/multicore-processing/)</sup> |
| 同时多线程 | 英特尔超线程技术通过复制寄存器文件并共享执行资源，让一个物理核心处理两个线程，使 CPU 利用率提高约 10–30%。<sup>[4](https://www.intel.com/content/www/us/en/support/articles/000098959/processors/intel-xeon-processors.html)</sup> |
| 缓存一致性 | 大多数设计使用 MESI 协议（Modified（已修改）、Exclusive（独占）、Shared（共享）、Invalid（无效））；有些使用 MOESI，增加一个 Owned 状态，允许修改过的数据在共享之后写回。<sup>[5](https://www.intel.com/content/www/us/en/developer/articles/technical/fast-core-to-core-communications.html)</sup> |
| 小芯片封装 | AMD 的“Zen”架构使用小芯片：每个小芯片容纳若干基于 Zen 的核心，可以向封装中加入更多小芯片以构成更高性能的型号。<sup>[6](https://www.amd.com/en/technologies/zen-core.html)</sup> |
| 核心数扩展 | AMD EPYC 9754 将八块“Zen 4c”裸片组合在一起，每块裸片有 16 个核心，从而在一个处理器中实现 128 个核心、256 个线程和 256 MB 三级缓存。<sup>[7](https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/white-papers/raising-the-bar-for-high-performance-solutions-in-the-public-sector.pdf)</sup> |
| 异构核心 | Arm 的 big.LITTLE 将高性能“大”核心与高能效“小”核心配对；Cortex-A7 比 Cortex-A15 更节能，因此低强度工作运行在小核心上。<sup>[8](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/power-management-with-big-little-a-technical-overview)</sup> |

## 处理器为何走向多核

整个 20 世纪 90 年代，性能提升主要来自提高时钟频率和加深单核流水线。当这条路径的收益递减时，体系结构设计师转而将多个完整核心放到一块裸片上，这种方法被描述为为计算增加了一个新维度：与其让一个工作单元更快，不如将更多独立核心装入单个封装。<sup>[9](https://arxiv.org/abs/1011.3382)</sup> 从这个意义上说，核心是一个完整的处理单元，拥有自己的控制逻辑、算术逻辑单元、寄存器以及一级和二级缓存，而更大的三级缓存和内存控制器通常由芯片上的各核心共享。<sup>[1](https://sei.cmu.edu/blog/multicore-processing/)</sup>

多核设计带来切实的好处：与分立处理器相比，同一芯片上核心之间距离更短，降低了资源访问延迟并提高了缓存速度；功耗下降，因为以热量形式浪费的能量更少；将软件隔离在独立核心上可以限制故障传播，并支持核心之间的故障转移。<sup>[1](https://sei.cmu.edu/blog/multicore-processing/)</sup>

## 阿姆达尔定律与扩展的极限

多核性能的核心约束是工作负载中的串行部分。阿姆达尔定律由[吉恩·阿姆达尔](https://www.edgepedia.org/zh/gene-amdahl)（Gene Amdahl）于 1967 年形式化提出，它给出 \( n \) 个处理器所能达到的最大加速比：\( S = 1 / (1 - P + P/n) \)，其中 \( P \) 是可以并行化的工作比例。<sup>[3](https://rc.dartmouth.edu/hpc-cookbook/fundamentals/parallel-computing/)</sup> 随着 \( n \) 增大，执行时间趋近于串行部分，超过该点再增加核心不会带来进一步加速。<sup>[3](https://rc.dartmouth.edu/hpc-cookbook/fundamentals/parallel-computing/)</sup> 因此，一个 90% 代码可并行化的工作负载，无论有多少核心可用，最多只能实现十倍加速。<sup>[2](https://technav.ieee.org/topic/multicore-processing/)</sup> 在规模扩大时，数字会变得严酷：一台希望获得 500 倍加速的 1000 核机器，需要 99.8% 的计算可并行化。<sup>[10](https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c21/c21s1/)</sup>

**古斯塔夫森的反论。** 古斯塔夫森（Gustafson）在 1988 年提出，程序员倾向于扩大问题规模以匹配可用计算能力，在差不多相同的时间内做更多计算，而不是更快地做同样的计算。在这种固定运行时间的假设下，可并行比例随核心数 \( N \) 增长，扩展加速比为 \( N + (1 - N) \cdot F_s \)，其中 \( F_s \) 是串行比例。<sup>[11](https://cvw.cac.cornell.edu/parallel/efficiency/amdahls-law)</sup> 天普大学的石源（Yuan Shi）经过仔细分析确定，这两条定律在数学上是等价的，它们之间被广泛报道的争论源于误解。<sup>[12](https://cis.temple.edu/~shi/wwwroot/shi/public_html/docs/amdahl/amdahl.html)</sup>

实际加速比也会低于理论曲线，因为基本定律忽略了额外开销。核心之间的通信和同步会降低并行加速比，因此处理同步强度和连接强度与并行化因子本身同样重要。<sup>[13](https://arxiv.org/abs/1306.3302)</sup> [内存带宽](https://www.edgepedia.org/zh/memory-bandwidth)是一个实际上限：共享内存总线的核心会争夺带宽，处理大型数据集的应用程序可能在达到理论并行极限之前就出现收益递减。<sup>[2](https://technav.ieee.org/topic/multicore-processing/)</sup>

## 共享缓存与一致性

同一芯片上的核心共享最后一级缓存、系统总线、内存控制器和互连，这种共享既带来性能问题，也带来隔离问题。<sup>[1](https://sei.cmu.edu/blog/multicore-processing/)</sup> 由于每个核心都有自己的缓存，硬件必须保持它们一致，也就是说，一个核心写入的值必须对其他核心可见。许多设计使用 MESI 协议，其中每条缓存行被标记为 Modified（已修改）、Exclusive（独占）、Shared（共享）或 Invalid（无效）；当一个核心希望写入一条其他核心以共享状态持有的缓存行时，必须首先通过片上归属代理使这些副本失效，该代理跟踪哪些核心持有每个地址。<sup>[5](https://www.intel.com/content/www/us/en/developer/articles/technical/fast-core-to-core-communications.html)</sup> 有些设计使用 MOESI，增加一个 Owned 状态，允许修改过的数据在共享之后而不是之前写回内存。<sup>[5](https://www.intel.com/content/www/us/en/developer/articles/technical/fast-core-to-core-communications.html)</sup> 这种芯片内部的消息传递会增加延迟，因此快速的核心间软件协议会尽可能避免一致性活动。<sup>[5](https://www.intel.com/content/www/us/en/developer/articles/technical/fast-core-to-core-communications.html)</sup>

**伪共享**是一种常见的一致性相关性能缺陷：当不同处理器上的线程修改恰好位于同一缓存行上的不同变量时，就会发生伪共享，即使这些线程并不共享数据，也会使该缓存行失效并强制更新。<sup>[14](https://www.intel.com/content/dam/develop/external/us/en/documents/gdma-2-165938.pdf)</sup>

由于缓存按先到先得分配，一个“吵闹邻居”应用程序可能过度占用共享的最后一级缓存，并拖慢另一个核心上运行的更高优先级应用程序，造成性能反转。英特尔的缓存分配技术通过让软件控制一个线程、应用程序、虚拟机或容器可以占用多少最后一级缓存来解决这个问题。<sup>[15](https://www.intel.com/content/www/us/en/developer/articles/technical/introduction-to-cache-allocation-technology.html)</sup>

## 线程、SMT 与调度

操作系统放到核心上的单元是线程。操作系统调度器将就绪线程映射到可用核心，使同一进程或不同进程的线程能够同时运行。<sup>[2](https://technav.ieee.org/topic/multicore-processing/)</sup> 除了物理核心之外，同时多线程（SMT）——英特尔以超线程之名营销——通过复制寄存器文件等组件并让两个线程共享核心的执行资源，使一个物理核心表现为两个逻辑处理器；英特尔报告利用率提升约 10–30%。<sup>[4](https://www.intel.com/content/www/us/en/support/articles/000098959/processors/intel-xeon-processors.html)</sup> 在虚拟化环境中，vCPU 是分配给虚拟机的核心或超线程的虚拟表示；一个启用超线程的 10 核至强可呈现 20 个线程，并可支持大约 20 个 vCPU。<sup>[4](https://www.intel.com/content/www/us/en/support/articles/000098959/processors/intel-xeon-processors.html)</sup>

编程模型隐藏了部分复杂性。OpenMP 使用编译器指令并行化 C、C++ 和 Fortran 中的循环和区域，广泛用于科学计算；POSIX 线程提供较低层的线程创建和同步；英特尔线程构建模块等任务并行框架让运行时调度器将工作动态分配给核心。<sup>[2](https://technav.ieee.org/topic/multicore-processing/)</sup>

## 异构核心与 NUMA

芯片上的核心不必全都相同。异构多核处理器混合不同核心类型，常常运行不同操作系统，并包含图形处理单元。<sup>[1](https://sei.cmu.edu/blog/multicore-processing/)</sup> Arm 的 big.LITTLE 技术将高性能“大”核心与高能效“小”核心结合起来，使合适的任务运行在合适的核心上；在其全局任务调度模型中，操作系统调度器了解容量差异，并将高性能线程负载均衡到大核心，将低强度或内存受限线程分配到小核心。<sup>[8](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/power-management-with-big-little-a-technical-overview)</sup> AMD 的异构设计同样将面向性能的经典核心与高能效的密集核心配对，将后台线程发送到密集核心，从而为经典核心上的高要求线程释放功耗余量。<sup>[16](https://docs.kernel.org/arch/x86/amd-hfi.html)</sup> Linux 内核通过容量感知调度支持此类系统，其中每个 CPU 的容量相对于系统中性能最高的 CPU 进行归一化，并由体系结构交给调度器。<sup>[17](https://docs.kernel.org/scheduler/sched-capacity.html)</sup>

在核心数更大时，内存访问变得非统一：在具有多个内存节点的系统上，访问时间取决于数据与核心之间的距离。Linux 调度器通过其调度域数据结构了解这种 NUMA 拓扑，并尝试尽量减少任务迁移到较远域，同时管理员可以使用 taskset(1) 和 numactl(1) 等工具将任务绑定，以改善局部性。<sup>[18](https://docs.kernel.org/mm/numa.html)</sup>

## 封装：从单片裸片到小芯片

历史上，所有核心、缓存和控制器都位于一块硅裸片上，一些处理器系列仍然如此；英特尔指出，其极致核心数至强型号改用多芯片模块（MCM）架构。<sup>[19](https://www.intel.com/content/www/us/en/support/articles/000099181/processors/intel-xeon-processors.html)</sup> 借助 Zen，AMD 使小芯片成为 x86 的主流方法：该公司不是生产越来越大的单片裸片，而是将一组 Zen 核心放在每个小芯片上，并将更多小芯片堆叠到一个封装中，从而得到更快的型号——这种安排将 AMD 的核心与 I/O 开发轨道分开，并允许针对速度或能效调优不同变体。<sup>[6](https://www.amd.com/en/technologies/zen-core.html)</sup> 这种方法可扩展到非常高的核心数：EPYC 9754 堆叠八块“Zen 4c”CPU 裸片，每块有 16 个核心，每个核心复合体有 32 MB 共享三级缓存，从而在单个处理器中实现 128 个核心、256 个线程和 256 MB 三级缓存。<sup>[7](https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/white-papers/raising-the-bar-for-high-performance-solutions-in-the-public-sector.pdf)</sup> [先进封装](https://www.edgepedia.org/zh/advanced-packaging)将同样的思路扩展到加速器：AMD 的 CDNA 5 架构将计算、内存、缓存和 I/O 功能划分到专用裸片上，并通过高密度裸片间互连堆叠 3D 混合键合计算裸片。<sup>[20](https://www.amd.com/en/technologies/cdna.html)</sup>

## References

1. [Multicore Processing, CMU Software Engineering Institute](https://sei.cmu.edu/blog/multicore-processing/)
2. [Multicore processing, IEEE Technology Navigator](https://technav.ieee.org/topic/multicore-processing/)
3. [Amdahl's Law, Cornell Virtual Workshop / Dartmouth HPC Cookbook](https://rc.dartmouth.edu/hpc-cookbook/fundamentals/parallel-computing/)
4. [What Are the Differences Between vCPU, Core, and Hyperthreading on an Intel Xeon Processor?](https://www.intel.com/content/www/us/en/support/articles/000098959/processors/intel-xeon-processors.html)
5. [Faster Core-to-Core Communications, Intel Developer Zone](https://www.intel.com/content/www/us/en/developer/articles/technical/fast-core-to-core-communications.html)
6. [AMD "Zen" Core Architecture](https://www.amd.com/en/technologies/zen-core.html)
7. [Raising the Bar for High-Performance Solutions in the Public Sector, AMD EPYC white paper](https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/white-papers/raising-the-bar-for-high-performance-solutions-in-the-public-sector.pdf)
8. [Power Management with big.LITTLE: A Technical Overview, Arm Community](https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/power-management-with-big-little-a-technical-overview)
9. [Multi-core: Adding a New Dimension to Computing, arXiv](https://arxiv.org/abs/1011.3382)
10. [Computation Structures, 21.1 Annotated Slides, MIT OpenCourseWare](https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c21/c21s1/)
11. [Amdahl's Law, Cornell Virtual Workshop](https://cvw.cac.cornell.edu/parallel/efficiency/amdahls-law)
12. [Reevaluating Amdahl's Law and Gustafson's Law, Yuan Shi, Temple University](https://cis.temple.edu/~shi/wwwroot/shi/public_html/docs/amdahl/amdahl.html)
13. [The Effect of Communication and Synchronization on Amdahl Law in Multicore Systems, arXiv](https://arxiv.org/abs/1306.3302)
14. [Avoiding and Identifying False Sharing Among Threads, Intel](https://www.intel.com/content/dam/develop/external/us/en/documents/gdma-2-165938.pdf)
15. [Introduction to Cache Allocation Technology in the Intel Xeon Processor E5 v4 Family](https://www.intel.com/content/www/us/en/developer/articles/technical/introduction-to-cache-allocation-technology.html)
16. [Hardware Feedback Interface for Hetero Core Scheduling on AMD Platform, Linux Kernel documentation](https://docs.kernel.org/arch/x86/amd-hfi.html)
17. [Capacity Aware Scheduling, Linux Kernel documentation](https://docs.kernel.org/scheduler/sched-capacity.html)
18. [What is NUMA?, Linux Kernel documentation](https://docs.kernel.org/mm/numa.html)
19. [Are the Intel Xeon Processor Families Single-Chip or Multi-Chip?](https://www.intel.com/content/www/us/en/support/articles/000099181/processors/intel-xeon-processors.html)
20. [AMD CDNA Architecture](https://www.amd.com/en/technologies/cdna.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Processors & processor engineering › Computer architecture theory › Multithreading and parallel architectures

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/multi-core-processor

English original: https://www.edgepedia.org/multi-core-processor
