473,748 Members | 7,118 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding number of Cores of The Processor

Hi,
I am using getProcessTimes API for calculating CPU Usage
On a Multi-Core processor i have observed that the %CPU Usage that is
multiple of the number of cores of the processor
Is there any API in VC to find the number of Cores of a processor?
(PS: Without using WMI ie)

url:http://www.ureader.com/gp/1452-1.aspx
Mar 8 '08 #1
3 3882
"Akash" <a@a.comwrote in message
news:35******** *************** *******@newspe. com...
I am using getProcessTimes API for calculating CPU Usage
On a Multi-Core processor i have observed that the %CPU Usage that is
multiple of the number of cores of the processor
Is there any API in VC to find the number of Cores of a processor?
(PS: Without using WMI ie)
Take a look at GetSystemInfo()

http://msdn2.microsoft.com/en-us/lib...58(VS.85).aspx

to see if it provides what you need.

Regards,
Will
Mar 8 '08 #2

Yes, there are some apis.
ask on win32 api newsgroup to get them :
news://nntp.aioe.org/comp.os.ms-wind...ogrammer.win32

--
lucas69
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Mar 9 '08 #3
The NUMBER_OF_PROCE SSORS environment variable tells you how many total
processors your PC has (number of CPUs times number of cores per CPU times 2
if hyperthreading is enabled)

Bob

Mar 10 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2011
by: athiane | last post by:
I want a way to parse out all function names that appear in a couple of C files. When the parsing logic finds a function name in a file, it should print out the Function name, line number and file in which the Function was found. What approach should i follow to tackle this problem ? Is there any option in the gcc compiler that prints out this information ?
5
4123
by: raybakk | last post by:
Hi there. If I make a function in c (I acually use gnu right now), is there any way to find out how many clocksycluses that function takes? If I divide some numbers etc Var1 = Var2/Var3, is it a fix amount of clocksycluses that is been used for that division, or does it varies? Raymond
14
2810
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given by df -k lopgod10:~/mycrfile # df -k /mnt/mvdg1/vset Filesystem 1K-blocks Used Available Use% Mounted on
2
6192
by: Jekyll | last post by:
hi, I have two questions, 1/ is there any OS function which return me the number of core on each processor on my computer (callable from C++) 2/ is there any OS function which return me the number of processor on my computer (callable from C++) By OS I mean Windows (XP and later), Linux, Solaris... Thanks XS
11
4920
by: John | last post by:
Is there a way to find the number of processors on a machine (on linux/ windows/macos/cygwin) using python code (using the same code/cross platform code)?
5
2007
by: whisk3rs | last post by:
Hello, I have a conceptual question. I need to write a program that will take as input a list of images and then process each image individually (extract useful features from the image) Processing each image takes about 20 seconds, and I would like to utilize all available cores / CPUs on a machine to do processing in parallel - for simplicity, I think it'd be easier for now to have each core process an individual image (rather than have...
1
1360
by: Jon Harrop | last post by:
I'd like to measure performance results as a function of the number of cores by restricting parallel FX to using only a subset of my cores. Is this possible and, if so, how? -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com/products/?u
9
7346
by: defn noob | last post by:
How can I check how many cores my computer has? Is it possible to do this in a Python-app?
9
1338
by: Carl Johansson | last post by:
If a multithreaded .NET application is executed on a computer with a multicore processor. Will the application automatically run the threads on different processor cores? Regards Carl Johansson
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.