uniprocessor or multiprocessor

老子叫甜甜 提交于 2019-12-12 04:22:14

问题


On unix, how could we know whether the system is multiprocessor or uniprocessor?


回答1:


Some times we have to answer owr own question :)

On Solaris run the command

/usr/sbin/psrinfo -v|grep "Status of processor"|wc -l

On AIX run the command

lsdev -C|grep Process|wc -l

On HP-UX run the following commands (requires superuser privileges):

P=`echo processor_count/D | adb -k /stand/vmunix /dev/mem |tail -1|awk '{print $2}'` echo "The number of processors on `hostname` = $P"

On Tru64 run the command

 /usr/sbin/psrinfo -v|grep "Status of processor"|wc -l



回答2:


How about

cat /proc/cpuinfo | grep -i 'processor' | wc -l

Or even

 dmesg | grep -i cpu

Look out for "Brought up x processors" in the last one




回答3:


I don't know if it applies to Unix as well, but for Linux, from command line, see here: http://www.howtogeek.com/howto/ubuntu/display-number-of-processors-on-linux/



来源:https://stackoverflow.com/questions/1699641/uniprocessor-or-multiprocessor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!