LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Limit Cpu Use Of Threads (http://www.linuxquestions.org/questions/programming-9/limit-cpu-use-of-threads-369315/)

yakotey 10-03-2005 07:00 AM

Limit Cpu Use Of Threads
 
Hello,

i have a problem : my c++ application is sometimes using 99 up to 100% of the CPU.

How can i limit this to 50% max?

thanks for any help.

jim mcnamara 10-03-2005 09:12 AM

If there are no other processes on the system that are active, this may be okay.

The best starting place is to alter prioirty before you try setrusage(). You can use nice to be sure that when your prgram is running and top shows it using lots of cpu, it is not competing with anyone else.


All times are GMT -5. The time now is 10:12 PM.