Are you using Linux? Don't know why it doesn't work for my Pentium D. Actually my Windows seems not show two processors at first, while the API may depend on OS. My Linux has no problem with this.
On the other hand, even your case is undesirable for Hyperthreading since we probably want more detailed info about processor(s) since hyperthreading sometimes wants to be treated differently than real SMP (or dual-core). I believe there is such kind of API available somewhere, at least NUMA support of Linux from SGI has it. Anyway before a more comprehensive API available, I really hope PORT can have my Windows + PentiumD give me two processors. Maybe this question should go to APR mailing list? Thanks, xiaofeng On 11/1/06, Mikhail Fursov <[EMAIL PROTECTED]> wrote:
I've tried Runtime.getRuntime().availableProcessors() right now and it works OK to me and reports "2". I have Prescott, 1CPU, 2 hyperthreads, WindowsXP. JNIEXPORT jint JNICALL Java_java_lang_VMExecutionEngine_getAvailableProcessors (JNIEnv *, jclass) { return port_CPUs_number(); } So if it's broken for you it's broken in Java too. On 11/1/06, Xiao-Feng Li <[EMAIL PROTECTED]> wrote: > > Hi, I am using port_CPUs_number() for GCv5 to get the processor > number, but my desktop returns one processor with it on Windows > although my processor is dual-core. (port_CPUs_number is defined in > port_sysinfo.h). > > I think we need more general form of processor number retrieval API > that can return processor information including that of core and > hyperthreading. > > How do you think? > > Thanks, > xiaofeng > -- Mikhail Fursov