availableDrocessors()为双核手机返回1 [英] availableProcessors() returns 1 for dualcore phones

查看:125
本文介绍了availableDrocessors()为双核手机返回1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近买了一部Moto Atrix 2手机。当我试图查看手机中的处理器规格时,
Runtime.getRuntime()。availableProcessors()返回1.
/ proc / cpuinfo也有关于处理器0的信息。

I recently bought a Moto Atrix 2 mobile. When I tried to look at the processor specs in the phone, Runtime.getRuntime().availableProcessors() returned 1. /proc/cpuinfo too had information about just processor 0.

出于好奇,我在朋友的三星Galaxy S2中检查了同样的信息,这也是一款双核手机。这也表明没有。核心是1。

Out of curiosity I checked the same in my friend's Samsung Galaxy S2, which is again a dual core phone. This too showed that no. of cores is 1.

我在我的Moto xoom平板电脑中检查了同样的内容,这也是双核心。这次availableProcessors()返回2,cpuinfo也有处理器0和处理器1的详细信息。

I checked the same in my Moto xoom tablet which is again dual core. This time availableProcessors() returned 2 and cpuinfo also had both processor 0 and processor 1 details.

我很困惑。为什么有些设备带有不同的信息有人可以解释这个异常吗?

I am confused. Why some devices carry different information? Can someone explain this anomaly?

推荐答案

Runtime.getRuntime()。availableProcessors()仅返回在线处理器的数量,因此当第二个核心处于休眠状态时它将返回1。这样做是为了在资源消耗较少的任务中保持功耗。

Runtime.getRuntime().availableProcessors() only returns the number of online processors, so it will return 1 when the second core is sleeping. This is done in order to preserve power during less resource-intensive tasks.

要查看所有可用内核,请查看/ sys / devices / system / cpu /

To see all available cores, look at /sys/devices/system/cpu/

这篇关于availableDrocessors()为双核手机返回1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆