I'm making a C# program, in my program, its call another program. The problem is the program that I called, its consume 100% of CPU. So I want to limit it to a const percentage of CPU usage. Its is posible and plz show me how. Thank you.
+4
A:
Is there any reason why you want to limit it to a specific percent of CPU usage? What about running it in lower priority, so that it still uses 100% of the CPU when nothing else requires it but gets put in the background when there are more important processes running?
Tal Pressman
2009-12-10 04:24:40
This still gives server admins the ability to control distribution of processing. While the CPU is not being used, it could be a good idea to give it 100%.
Russell
2009-12-10 04:25:44
So good answer Tal :)
Russell
2009-12-10 04:28:18
It's ok to run the the CPU 100% 24/24?
Mr.Bua
2009-12-10 11:30:55
The CPU is there to process things... There's no reason not to use it. Of course, you should make sure there are no bugs causing you to "waste" CPU time, keeping it at 100% even though there's nothing useful happening, but other than that there's usually no reason to limit CPU usage.
Tal Pressman
2009-12-15 02:06:12
A:
The operating system should handle the time sharing between your two applications. There is probably a good reason your application is using 100% of the CPU, it is calculating something. If you need to wait for the completion of another process then you can use Process.WaitForExit to halt the execution of the calling thread while the other process completes.
stimms
2009-12-10 04:35:55