• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Somewhat technical question about CPU %usage

Special K

Diamond Member
If this isn't quite techical enough then I'll just move it to GH. Here is my question: Windows reports the %CPU usage for processes in its task manager. Now from what I understand, the latest processors can dispatch multiple instructions at once so that they have multiple execution units working on different types of instructions at the same time. My question is, what exactly is windows reporting when a process is listed as having 99% CPU util? Does that mean that all of the execution units are working on instructions for that process or what? I was under the impression that not all of the execution units were typically in use at one time. Could someone explain this to me?
 
Only 1 process is executing per CPU at a time. So that's most likely just the percentage of it's timeslice (differs between scheduler implementations) in 1 second, divided by the total runnable processes. So if the scheduler gives each process 100ms per timeslice and it used 80ms before it slept (waiting on disk I/O, input, whatever) and it's the only process in the run queue it got 80% of the cpu time.

Or I could be way off and talking out of my ass =)
 
As I understand it, nothinman is correct...

Multitasking works by switching to the scheduler (a process of its own) whenever a task switch occurs or an application yields its CPU time. The idle time is found by how much time the task scheduler gets. If no apps are doing anything, the scheduler just switches to itself over and over, and records the CPU time. At least that is how it works "back in the day" according to an old, awesome C book I have 😀
 
So if the scheduler gives each process 100ms per timeslice and it used 80ms before it slept (waiting on disk I/O, input, whatever) and it's the only process in the run queue it got 80% of the cpu time.

does the scheduler allocate more time to more processor intensive programs? otherwise programs would run at the same speed no matter the number of other applications running.
 
does the scheduler allocate more time to more processor intensive programs? otherwise programs would run at the same speed no matter the number of other applications running.

Isn't this the concept behind priority levels? Such as DC programs that claim to run at the lowest possible priority and are given CPU time only after anything with a higher priority has gotten a chance.
 
does the scheduler allocate more time to more processor intensive programs? otherwise programs would run at the same speed no matter the number of other applications running.

Depends on the scheduler, I know Linux gives CPU intensive processes a performance _hit_ to keep interactive tasks responsive. I believe Windows does the same, but not sure.

The second part can't be true, because when the scheduler goes over the run queue (task waiting to run) if there's 5 waiting they share the CPU among them each getting their turn, if there's only 1 it gets to go every time.

Isn't this the concept behind priority levels? Such as DC programs that claim to run at the lowest possible priority and are given CPU time only after anything with a higher priority has gotten a chance.

Pretty much. But the scheduler adjusts the processes priority at runtime too depending on whether the app is I/O bound or CPU bound, to keep everything equal.
 
Back
Top