LinuxQuestions.org
Visit the LQ Articles and Editorials section
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

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 01-05-2009, 09:39 AM   #1
kirankumarburgu
LQ Newbie
 
Registered: Jan 2009
Posts: 1
Thanked: 0
CPU hogging.


[Log in to get rid of this advertisement]
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
kirankumarburgu is offline  
Tag This Post ,
Reply With Quote
Old 01-05-2009, 11:08 AM   #2
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: Slackware 12.1
Posts: 449
Thanked: 51
Your language is not quite understandable at a crucial point in the sentence. Could you ask this in different words, please?
wje_lq is offline     Reply With Quote
Old 01-05-2009, 11:33 AM   #3
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 286
Thanked: 1
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.
rtspitz is offline     Reply With Quote
Old 01-05-2009, 12:02 PM   #4
theNbomr
Senior Member
 
Registered: Aug 2005
Distribution: Open Suse, Fedora, Redhat
Posts: 2,272
Thanked: 74
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.
theNbomr is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 01:51 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration