hmm... well... i don't know much about hyper threading, but i think it essentially makes the computer run as if it is a dual-CPU setup. if that is the case though, you wont be able to reap the benefits of that with winXP home, because winXP home doesn't support dual processors...
just a thought, i don't know that it has to do with anything...
CPU utilization
I just got a new laptop with XP Home on it - I'll test in just a second!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Hmmm
Hmmm.. if you have Windows XP, you are more than likely going to get the 100% CPU as needed. If you are not, try this.
Go into System Properties, select the Advanced tab. Then click the Performance options button.
You are presented with two options, Optimize performance for Applications, or Optimize performance for Background services. Select the Optimize performance for Applications as your program is an application in this context.
I think this could be why some are getting the full 100% cpu utilization and you are not. I noticed also that you mentioned your Windows Media player as getting a heftier allocation of system resources, this could happened because the Windows Media player is registered as a background service and your application is not.
Also, make sure you disable any services that are background services like a firewall or anti-virus software you have running. If your Windows settings (see above) are set to optimize performance of background services, then this explains why your CPU will not grant more than xx% of your application.
Lj
Go into System Properties, select the Advanced tab. Then click the Performance options button.
You are presented with two options, Optimize performance for Applications, or Optimize performance for Background services. Select the Optimize performance for Applications as your program is an application in this context.
I think this could be why some are getting the full 100% cpu utilization and you are not. I noticed also that you mentioned your Windows Media player as getting a heftier allocation of system resources, this could happened because the Windows Media player is registered as a background service and your application is not.
Also, make sure you disable any services that are background services like a firewall or anti-virus software you have running. If your Windows settings (see above) are set to optimize performance of background services, then this explains why your CPU will not grant more than xx% of your application.
Lj
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
After doing that LJ say, you can test it with something like:
Which must absorb 99% of task processes because PB task is an aplication at first plane now.
Doing EventID.l=WaitWindowEvent() make PB task to be locked and should appear 00% in the task process manager.
AL
Code: Select all
OpenWindow(0,200,200,200,200,#PB_Window_SystemMenu,"Title")
Repeat
EventID.l=WindowEvent()
Until EventID=#PB_Event_CloseWindow
Doing EventID.l=WaitWindowEvent() make PB task to be locked and should appear 00% in the task process manager.
AL
I tested both apps and both are using 100% of my CPU.
System: AMD Duron 950, 256MB ram, WinXP home.
@Aszid: you could be right, but Tiuri mentioned that Windows MovieMaker is using 100%...
So if it is a OS limitation, why is Windows MovieMaker using 100% ?
@Karbon: if you have a Celeron Laptop you don't have HT.(AFAIK)
@Tiuri: have you looked at your BIOS ? Maybe there is a setting for it...
As a test: maybe it's good to change the test code to use threads and see what happens...
System: AMD Duron 950, 256MB ram, WinXP home.
@Aszid: you could be right, but Tiuri mentioned that Windows MovieMaker is using 100%...
So if it is a OS limitation, why is Windows MovieMaker using 100% ?
@Karbon: if you have a Celeron Laptop you don't have HT.(AFAIK)
@Tiuri: have you looked at your BIOS ? Maybe there is a setting for it...
As a test: maybe it's good to change the test code to use threads and see what happens...
I am to provide the public with beneficial shocks.
Alfred Hitshock
Hi,
thanks for all you comments so far.
LJ : I checked the settings (apparently named somewhat differently under XPHome) but they were already set be optimized for programs, not background tasks. So this is not likely to be the problem.
I haven't figured things out yet with any certainty, but now that the discussion appears to be active some more of my thoughts after spending some time looking for info on hyperthreading. At the risk of telling you things everybody already knows:
As said above by others, hyperthreading indeed makes the OS think that there are two processors. There are not only two plots in the Task manager, but also everywhere else in the system resources two processors are listed (also under XP Home?). I would guess the advantage of this could be that a second thread is always waiting at the processor level rather than at the OS level, and the processor can somehow switch between the two very rapidly, using unused CPU resources even in chunks that would be too small to be noticed or usable by the process monitoring threads at the OS level. This does not help at all of course when a thread uses the CPU without any interuption.
(an interesting remark that I found on another forum was that this actually screws up the priority system of tasks in the OS, since the OS can assign a low priority task to what it thinks is an unused processor, which then competes with the higher priority task..)
Back to my problem:
I now suspect that although Task Manager reports only 50% CPU utilization on my system, this is only because it thinks there are two processors, and in reality I am getting 100% of the physical CPU. A simple high level test of this would be if one of you could measure the physical time it takes to for my RabbitWorld program to take 100 time steps on a system with a similar CPU. 100 steps take about 30 seconds on my system.
This still doesn't explain everything though.
Regarding MovieMaker 2 getting close to 100%: maybe it is such a new program that it is written to be optimized for hyperthreading, in such a way that it can utilize the two "logical" processors in a optimal way.
Regarding other people reporting 100% running my program: maybe XPPro is more clever in reporting the CPU usage somehow. Just to be sure, you do have hyperthreading enabled, i.e your system lists two processors?
Finally, maybe XP Home is indeed very bad at using the hyperthreading since there seems to be an enormous overhead associated with running two processes simultaneously. If I run two instances of the program at the same time, it takes 96 seconds for both programs to advance 100 steps, instead of the 60 seconds that you would expect by adding the times of the individual programs.
thanks for all you comments so far.
LJ : I checked the settings (apparently named somewhat differently under XPHome) but they were already set be optimized for programs, not background tasks. So this is not likely to be the problem.
I haven't figured things out yet with any certainty, but now that the discussion appears to be active some more of my thoughts after spending some time looking for info on hyperthreading. At the risk of telling you things everybody already knows:
As said above by others, hyperthreading indeed makes the OS think that there are two processors. There are not only two plots in the Task manager, but also everywhere else in the system resources two processors are listed (also under XP Home?). I would guess the advantage of this could be that a second thread is always waiting at the processor level rather than at the OS level, and the processor can somehow switch between the two very rapidly, using unused CPU resources even in chunks that would be too small to be noticed or usable by the process monitoring threads at the OS level. This does not help at all of course when a thread uses the CPU without any interuption.
(an interesting remark that I found on another forum was that this actually screws up the priority system of tasks in the OS, since the OS can assign a low priority task to what it thinks is an unused processor, which then competes with the higher priority task..)
Back to my problem:
I now suspect that although Task Manager reports only 50% CPU utilization on my system, this is only because it thinks there are two processors, and in reality I am getting 100% of the physical CPU. A simple high level test of this would be if one of you could measure the physical time it takes to for my RabbitWorld program to take 100 time steps on a system with a similar CPU. 100 steps take about 30 seconds on my system.
This still doesn't explain everything though.
Regarding MovieMaker 2 getting close to 100%: maybe it is such a new program that it is written to be optimized for hyperthreading, in such a way that it can utilize the two "logical" processors in a optimal way.
Regarding other people reporting 100% running my program: maybe XPPro is more clever in reporting the CPU usage somehow. Just to be sure, you do have hyperthreading enabled, i.e your system lists two processors?
Finally, maybe XP Home is indeed very bad at using the hyperthreading since there seems to be an enormous overhead associated with running two processes simultaneously. If I run two instances of the program at the same time, it takes 96 seconds for both programs to advance 100 steps, instead of the 60 seconds that you would expect by adding the times of the individual programs.