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