CPU utilization for a multiple cpu computer and calculating

Hello,
I am writing a c++ program for calculating CPU utilization of a
computer that has multiple CPUs. If anyone knows of a API or library
call,please inform me.

Also, what is the quickest way to find the amount of free space on a mount
point for a c++ program.

Thanks,

Sabtain

Hi Sabtain,

Use ClockTime() to generate a clock id for the first threads of procnto (pid 1).
They are the idle threads for each processor.

You can then poll them at regular intervals to gauge how long they have been running.
The processor usage can be determined by the ratio of interval to nsecs executed.

Regards,

Colin

sabtain wrote:

Hello,
I am writing a c++ program for calculating CPU utilization of a
computer that has multiple CPUs. If anyone knows of a API or library
call,please inform me.

Also, what is the quickest way to find the amount of free space on a mount
point for a c++ program.

Thanks,

Sabtain


cburgess@qnx.com

Thanks for replying but I have a further quesiton. Even on a single
processor PC, the procnto has 11 threads running. what does that mean?


“Colin Burgess” <cburgess@qnx.com> wrote in message
news:fgqr9o$o8e$1@inn.qnx.com

Hi Sabtain,

Use ClockTime() to generate a clock id for the first threads of
procnto (pid 1).
They are the idle threads for each processor.

You can then poll them at regular intervals to gauge how long they have
been running.
The processor usage can be determined by the ratio of interval to nsecs
executed.

Regards,

Colin

sabtain wrote:
Hello,
I am writing a c++ program for calculating CPU utilization of a
computer that has multiple CPUs. If anyone knows of a API or library
call,please inform me.

Also, what is the quickest way to find the amount of free space on a
mount point for a c++ program.

Thanks,

Sabtain


cburgess@qnx.com

procnto starts a threadpool to handle it’s resource managers. In a normal scenario they are pretty much all idle,
awaiting messages.

sabtain wrote:

Thanks for replying but I have a further quesiton. Even on a single
processor PC, the procnto has 11 threads running. what does that mean?


“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:fgqr9o$o8e$> 1@inn.qnx.com> …
Hi Sabtain,

Use ClockTime() to generate a clock id for the first threads of
procnto (pid 1).
They are the idle threads for each processor.

You can then poll them at regular intervals to gauge how long they have
been running.
The processor usage can be determined by the ratio of interval to nsecs
executed.

Regards,

Colin

sabtain wrote:
Hello,
I am writing a c++ program for calculating CPU utilization of a
computer that has multiple CPUs. If anyone knows of a API or library
call,please inform me.

Also, what is the quickest way to find the amount of free space on a
mount point for a c++ program.

Thanks,

Sabtain

cburgess@qnx.com


cburgess@qnx.com

sabtain wrote:

Also, what is the quickest way to find the amount of free space on a mount
point for a c++ program.

Look at the statvfs() function …