cpu-cores

Programmatically get CPU core count

I have some multi threaded code that makes one thread per core except I'm having troubles working out how to get the core count under windows. For linux i have: //from http://www.cplusplus.com/forum/unices/6544/ FILE * fp; char res[128] = {0}; fp = popen("/bin/cat /proc/cpuinfo |grep -c '^processor'","r"); fread(res, 1, sizeof(res)-1, ...

Cross-platform API for system information

I'm looking for a library that will provide this type of information: RAM Swap space Number of CPUs speed (CPU MHz) Number of cores Chip type Ultimately I'll be calling into it from Java, but a C library would be fine, which I can wrap with JNI. Platforms of interest include, but not limited to, AIX, HP-UX, Solaris, Windows. Thanks! ...

How to find the Number of CPU Cores via .NET/C#?

Hi, Is there a way via .NET/C# to find out the number of CPU cores? Thanks! PS This is a straight code question, not a "Should I use multi-threading?" question! :-) ...

JAVA: How to scale threads according to cpu cores?

Hi everyone, I'm new to this site and glad to be here :). I'm not a good java programmer, it's just my hobby, but I'm eager to know more than average stuff. I want to solve a mathematical problem with multiple threads in java. my math problem can be separated into work units, that I want to have solved in several threads. but I don't ...

Is there a way to reliably detect the total number of CPU cores?

I need a reliable way to detect how many CPU cores are on a computer. I am creating a numerically intense simulation C# application and want to create the maximum number of running threads as cores. I have tried many of the methods suggested around the internet like Environment.ProcessorCount, using WMI, this code: http://blogs.adamsof...

How to get number of cores in C?

I'm writing a program in C on windows that needs to run as many threads as available cores. But I dont know how to get the number of cores. Any ideas? ...

tomcat multithreading problem

Hi all I'm writing a java application that runs in Tomcat, on a multi-core hardware. The application executes an algorithm and returns the answer to the user. The problem is that even when I run two requests simultaneously, the tomcat process uses at most one CPU core. As far as I understand each request in Tomcat is executed in separate...

Get number of CPU cores in JavaScript?

Is there a way to determine the number of available CPU cores in JavaScript, so that you could adjust the number of web workers depending on that? ...