Linux-CpuInfo
转自http://blog.51cto.com/icooke/757555 在Linux系统中,如何详细了解CPU的信息呢? 当然是通过cat /proc/cpuinfo来检查了,但是比如几个物理CPU/几核/几线程,这些问题怎么确定呢? 经过查看,我的开发机器是1个物理CPU,4核8线程,Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz 记录一下,判断的过程和知识。 判断依据: 1.具有相同core id的cpu是同一个core的超线程。 2.具有相同physical id的cpu是同一颗cpu封装的线程或者cores。 英文版: 1.Physical id and core id are not necessarily consecutive but they are unique. Any cpu with the same core id are hyperthreads in the same core. 2.Any cpu with the same physical id are threads or cores in the same physical socket. echo "logical CPU number:" #逻辑CPU个数 cat /proc/cpuinfo | grep "processor" | wc -l echo