我在谷歌上搜索如何找到一台机器中的 CPU 数量,我找到了一些帖子,但我很困惑,因为有些人提到你获得逻辑内核与物理内核等。
那么逻辑内核和物理内核之间有什么区别,是有没有办法只获得物理内核?或者在我们的计数中包括逻辑核心是否有意义?
lscpu
我的电脑的输出看起来像 -
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 69
Stepping: 1
CPU MHz: 1200.093
BogoMIPS: 3392.08
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3
Run Code Online (Sandbox Code Playgroud)
这是否意味着我有 4 个 CPU 和 2 个内核?