LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 10-03-2005, 08:00 AM   #1
yakotey
LQ Newbie
 
Registered: Jun 2005
Posts: 22

Rep: Reputation: 0
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.
 
Old 10-03-2005, 10:12 AM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
limit CPU consumption eantoranz Linux - Security 3 07-19-2005 09:32 PM
Limit the performance of CPU? LostIn Linux - Hardware 8 05-23-2005 08:32 PM
Threads - Max Limit socratesinus Linux - Software 5 04-20-2005 04:43 PM
what means cpu limit? joda Linux - General 0 01-15-2004 10:23 AM
Limit CPU on Certain Apps? GT_Onizuka Linux - Newbie 3 11-16-2003 03:05 PM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration