LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-05-2009, 08:39 AM   #1
kirankumarburgu
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 0
CPU hogging.


Hi all,

i just put while(1) in main and exuected that on one of the linux, top shows 99.9 cpu utilization is hogged by this process, in this case if i executed any other process on this machine,it shouldt get any processor time but its not happening......can someone tell me reason for this.

Thanks in advance,
Kiran
 
Old 01-05-2009, 10:08 AM   #2
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: Debian lenny, Slackware 12
Posts: 808

Rep: Reputation: 178Reputation: 178
Your language is not quite understandable at a crucial point in the sentence. Could you ask this in different words, please?
 
Old 01-05-2009, 10:33 AM   #3
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
you need to start your code 'niced'.

Code:
nice -n 19 name_of_your_executable
this will make sure this job does not hog cpu time, when it is needed elsewhere.
 
Old 01-05-2009, 11:02 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Your program is requesting (by not sleeping or waiting) CPU time, which it is getting because no other process is reequesting CPU cycles. The scheduler in the kernel will try to share the CPU equitably according to its algorithms to all processes that want it. So as soon as processes compete for CPU time, they will be given their fair share, which seeems to be what you are seeing.
--- rod.
 
  


Reply

Tags
cpu


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
artsd problem hogging cpu and memory jolphil Mandriva 2 04-15-2007 06:53 AM
Printing and lpd demon hogging cpu windsurfer Linux - Software 2 02-19-2007 03:48 AM
Zombie/Sleeping processes hogging CPU nomind Linux - General 2 04-21-2006 11:22 AM
What's hogging all my memory? cdavidson Linux - Newbie 5 03-29-2005 03:15 PM
bittorrent hogging the bandwidth PawnsharK Linux - Software 0 05-23-2004 10:17 AM


All times are GMT -5. The time now is 05:56 PM.

Main Menu
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