CPU hogging.
Hi all,
i just put while(1) in main and exuected that on one of the linux, top shows 99.9 cpu utilization is hogged by this process, in this case if i executed any other process on this machine,it shouldt get any processor time but its not happening......can someone tell me reason for this. Thanks in advance, Kiran |
Your language is not quite understandable at a crucial point in the sentence. Could you ask this in different words, please?
|
you need to start your code 'niced'.
Code:
nice -n 19 name_of_your_executable |
Your program is requesting (by not sleeping or waiting) CPU time, which it is getting because no other process is reequesting CPU cycles. The scheduler in the kernel will try to share the CPU equitably according to its algorithms to all processes that want it. So as soon as processes compete for CPU time, they will be given their fair share, which seeems to be what you are seeing.
--- rod. |
All times are GMT -5. The time now is 07:49 PM. |