调用Runtime.getRuntime()。availableProcessors() [英] Runtime.getRuntime().availableProcessors()

查看:788
本文介绍了调用Runtime.getRuntime()。availableProcessors()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检查程序的性能。我将这篇文章称为获取操作系统级系统信息。执行 Runtime.availableProcessors()时,我得到 4 的答案。我读了 availableProcessors()但是它告诉这个方法返回处理器数量

I am trying to check the performance of a program. I refer this post get OS-level system information. When Runtime.availableProcessors() executes, I get an answer of 4. I read availableProcessors() but it tells that this method returns number of processors


  1. 任何人都可以解释处理器数量的含义吗?

  2. 为什么得到4结果?

我使用的是Windows 7核心i5 4gp。

I am using Windows 7 core i5 4gp.

推荐答案

处理器的数量基本上是能够运行代码的执行引擎的数量。其中一款i5型号是4核CPU,即i5-7系列。这些可能是物理上不同的处理器(即使它们存在于同一芯片内),或者当您使用超线程时它们可能是逻辑处理器。

The number of processors is basically the number of execution engines capable of running your code. One of the i5 variants is a 4-core CPU, the i5-7 series. These may be physically distinct processors (even though they exist inside the same chip) or they may be logical processors when you're using hyper-threading.

参见 http://en.wikipedia.org/wiki/Intel_Core#Core_i5 http://en.wikipedia.org/wiki/Hyper-threading 了解更多详情。

这篇关于调用Runtime.getRuntime()。availableProcessors()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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