0
1
I wrote an infinite loop in python to print No! in the output.
while True:
print("No!")
When I execute it, I see its process (pythonw.exe) in Windows-Task-Manager that uses 60% of the CPU. I did a right-click on its process and change the priority to Low. it use 60% of CPU again! Then I change the priority to Real-Time. It still uses 60% of CPU !
Update: My total CPU usage for all process is 80%!!! and 20% is free! Why this python loop doesn't use this 20%?!
What's wrong with priority? Why it doesn't change?
1Because the x86 instructions required to do this don't take more than 60% of a single clock cycle – Ramhound – 2014-09-26T16:32:41.440
Would you please explain it more clear as an answer? Why those instructions doesn't take more than 60% of a single clock cycle in x86? is it different in x64? – TheGoodUser – 2014-09-26T16:40:11.523
X64 is an extension of the x86 architecture, what part, don't you understand exactly – Ramhound – 2014-09-26T16:57:29.323
@Ramhound 1- x86 instructions required to do this don't take more than 60% of a single clock cycle. Why?! And 2- Why when I set its priority to Low it still use 60%? Why doesn't it reduces? – TheGoodUser – 2014-09-26T17:06:08.963
Because the load delta caused by this script and the load without the script the processor doesn't have to prioritize the threads. As for the other part unless you know x86 assembly any additional details wouldn't be helpful – Ramhound – 2014-09-26T17:09:45.110
@Ramhound Would you please try me! I know assembly a little :D I may find it helpful! – TheGoodUser – 2014-09-26T17:31:47.413
Feel free to covert that to assembly yourself than to understand what's actually happening – Ramhound – 2014-09-26T17:54:19.953
It is not possible for an instruction to use a fraction of a single clock cycle. An executing program can, however, use only 60% of the total available clock cycles. – Jamie Hanrahan – 2018-12-26T18:39:46.413