4
5
Assume the computer has a single core - what exactly does it mean for process A to be running at 100% CPU capacity vs (lets say) 10% CPU capacity.
If the CPU was 2.0 GHz, does that mean in a time slice for process A, that the processor was executing 2 billion steps per second (if at 100% cap), but would only be executing 200 million steps (if at 10% cap)?
What would cause the 100% scenario vs the 10% scenario?
The different between 10% usage and 100% usage is clear. In one case the task in question is taking 10% of the executing capabilities. In other words everytime the clock is trigged, 10% of the execution time, is assigned to that process. Likewise 100% usage means 100% of the execution time is assigned to that process ( i.e. no other proceses tasks are able execuate ) thus creating a deadlock situation. My example uses a single process to make the process of the CPU running a task easier to understand. – Ramhound – 2013-11-14T19:03:48.850
When you say 'everytime the clock is triggered', is that the same thing as a time slice or is that an actual tick of the CPU? – Dave Stibrany – 2013-11-14T19:12:46.170
@DaveStibrany in this case, it's just a generic time-slice assigned by the OS task scheduler (you should be able to find granularity details for your specific OS/processor architecture if you need actual numbers). Going back to the infinite-loop idea, if I wrote a program that just had a big list of
NOP
instructions, that would still technically classify as CPU use (during the time slices where the OS says to that program "Ok, it's your turn to run for the next X microseconds", even if my program is doing nothing, it is still running - and that's what CPU Usage Percentage describes.) – Breakthrough – 2013-11-14T19:15:24.383@DaveStibrany - Lets say you have a 2Ghz Intel CPU. This means that everytime the clock signal is triggered the CPU will process
X
x86 operation instructions. How many insructions are actually performed depends on several different things. If you have a 2-core x86 CPU it means that you can perform 2 seperate instructions in the same amount of time. This means either 2 different processes have equal priority or a single process can perform an instruction twice as fast ( requires you to write said operation in a certain way in order to do so ). – Ramhound – 2013-11-14T19:22:55.373A great starting point to understand what actually happens during a clock cycle is to learn the x86 assembly language. Once you do that you understand what an instruction is. – Ramhound – 2013-11-14T19:25:36.427