Processor Utilization Question

PurdueTech

Member
Jun 28, 2001
73
0
0
I am working on a project for my school and I was wondering if anyone knew the answer to the
following situation:

When you start a program and it uses, for example, 6% of you cpu (like in the cpu usage monitor)
if you open a second program that uses another 6% of your cpu(again like in the cpu usage monitor)
will this slow down the operations of the first program?

If I understand this right, it would not because you would only be using 12% of your cpu.
Therefore you can run one program and it won't slow down other programs unless the cpu usage
is 100%.

Is that guess correct at all?

Please let me know if you don't understand the question and I will try to rephrase it.
Thanks a bunch for any input.
 

Haden

Senior member
Nov 21, 2001
578
0
0
Both programs should run at max speed, if they are using only 6% of cpu this means that they are I/O intensive or release cpu (sleep) very often.
However there can be minor (very very minor) impact because it's one more process for OS task sheduler to take care (sheduler blocks/unblocks processes gets them to running/sleeping mode etc.)

Just my 0.02
 

interchange

Diamond Member
Oct 10, 1999
8,025
2,876
136
That's a really complicated question, actually.

Basically one CPU can work on one task at one time. Modern CPUs are pipelined heavily so that they can be performing mulitiple stages of an operation simultaneously in one clock cycle (think of it like doing multiple loads of laundry; you don't wait for one load to wash and dry before washing another). And modern CPUs are superscalar, kind of like having multiple washing machines.

Even still, each CPU will only be assigned to work on one process at a time. When a process idles, it will switch control to another process and work on it; switch back; etc. Really, these things are usually further broken down into threads but you get the basic idea.

If something has a lot of I/O (input/output) from/to the hard drive, RAM instead of cache, etc. then it will have a lot of CPU clock cycles wasted while waiting for data which is the most likely reason a process would run only 6% CPU usage. For computatioinally intensive one-time programs, they should max out your CPU.

All this being said, having two processes at 6% utilization won't necessarily mean 12% continual utilization at no speed cost. There could be competition for I/O resources or bad process management or bad program design, etc. A lot will depend on the compiler that wrote your program for your hardware and OS.

Short answer: Computers are going to do a lot of things inefficiently no matter what.
 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0

It's actually going to use 100% of the cpu, but only 12% of the time. It's a wierd way to state it but it doesn't change the end result: the 2nd app won't really slow down the first unless both combined are using 100% of the cpu 100% of the time. There is some overhead swapping back and forth between them but it's negligible.

BUT this is all assuming the CPU is the bottleneck for the apps and not some other device.

For instance:
If you are installing two programs from two CDROM drives to your computer each setup program will be drastically slowing down the other because your PCI bus, IDE card or several other things are causing the bottleneck. The CPU in this instance will be sitting near idle while the rest of your PC is breaking a sweat.



 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: Smilin
It's actually going to use 100% of the cpu, but only 12% of the time. It's a wierd way to state it but it doesn't change the end result: the 2nd app won't really slow down the first unless both combined are using 100% of the cpu 100% of the time. There is some overhead swapping back and forth between them but it's negligible.

If we're being nitpicky, you are using 100% of the processing power as designed, but many functional units are idle - which is partially improved with hyperthreading ;)