Re: Detecting CPUs and cores
- From: "Daniel Dyer" <"You don't need it">
- Date: Mon, 30 Jul 2007 22:56:05 +0100
On Mon, 30 Jul 2007 21:59:10 +0100, Joshua Cranmer <Pidgeot18@xxxxxxxxxxx> wrote:
On Mon, 30 Jul 2007 13:25:52 -0500, Chris wrote:
Is there any way for Java to detect the number of CPUs that are
available? Runtime.getRuntime().availableProcessors() returns the number
of cores, not CPUs.
I don't think that is possible. The only OS I have experience with is
Windows, and that treats a dual-core as two CPUs; I believe that *nix
systems do the same as well.
I think that's reasonable behaviour. My dual-core Mac does the same under OS X.
What's slightly less helpful is that my Windows PC at work returns 2 from availableProcessors() despite the fact that it is single-core, albeit with Intel's Hyper-Threading.
Finding out any more about the processors is probably going to require some JNI.
Dan.
--
Daniel Dyer
http//www.uncommons.org
.
- Follow-Ups:
- Re: Detecting CPUs and cores
- From: Lew
- Re: Detecting CPUs and cores
- References:
- Detecting CPUs and cores
- From: Chris
- Re: Detecting CPUs and cores
- From: Joshua Cranmer
- Detecting CPUs and cores
- Prev by Date: Re: masks and enums
- Next by Date: Re: AWT tutorial
- Previous by thread: Re: Detecting CPUs and cores
- Next by thread: Re: Detecting CPUs and cores
- Index(es):
Relevant Pages
|