Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dual-core processor. I'm running two instances of the program below:

void main(){
    int i;

I run TOP and CPU usage gets up to 97%, however it never reaches 100%, why doesn't it? CPU is supposed to be always busy running the two programs with no I/O operation.

Thank you

share|improve this question
It has to do with the OS is time slicing, and may reserve a small potion to accept interupts. Different priorities, different cpus (multi-core?), and even compiler flags can have an affect. – hydroparadise Sep 27 '12 at 14:17
if CPU usage reached 100%, would the system crash? – ostri Sep 27 '12 at 14:24
I'm slightly surprised the compiler didn't optimize away all the code. The code is functionally identical to void main(){} isn't it? I would expect maxint to be reached almost instantly, presumably integer overflow is not regarded as noteworthy by your C compiler. – RedGrittyBrick Sep 27 '12 at 14:26
@ostri: No. operating systems have higher priority than apps and (on modern mass-market CPUs) run in a privileged CPU state that gives them control over runaway apps (in theory anyway). – RedGrittyBrick Sep 27 '12 at 14:28
@RedGrittyBrick Think your comment/question would be more interesting for the SO. And isn't integer overflow more to do with CPU instructions? Think MMX – hydroparadise Sep 27 '12 at 14:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.