LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-19-2011, 04:32 PM   #1
fancylad
Member
 
Registered: Mar 2008
Distribution: slackware
Posts: 175

Rep: Reputation: 19
understandng process states


Can someone explain to me the difference between a process that is in a sleeping state versus a running state? I thought a process was sleeping if it was waiting for something or if the cpu was running another process. For instance I am running mplayer from the cli to listen to a music stream:

Quote:
matt@foo:~$mplayer -playlist groovesalad130.pls
Now if I check on the state of mplayer I see that it is sleeping:

Quote:
matt@amd:~$ps -el | grep mplayer
F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
0 S 1000 7187 3932 1 80 0 - 63135 hrtime pts/1 00:05:07 mplayer
1 S 1000 7188 7187 0 80 0 - 61783 hrtime pts/1 00:00:12 mplayer
0 S 1000 8376 8289 1 80 0 - 63134 hrtime pts/6 00:00:01 mplayer
1 S 1000 8377 8376 0 80 0 - 61783 hrtime pts/6 00:00:00 mplayer
I don't understand how the state can always be sleeping if I am listening to a music stream with mplayer.
 
Old 01-19-2011, 07:00 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
It isn't always sleeping, just when you choose to look ....

All those fields are "instantaneous" - i.e. only at the instant you look.
 
Old 01-19-2011, 08:13 PM   #3
fancylad
Member
 
Registered: Mar 2008
Distribution: slackware
Posts: 175

Original Poster
Rep: Reputation: 19
Even when I use top it is always sleeping. I never see it in a running state, ever.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
states in iptables deadeyes Linux - Security 4 12-14-2009 01:51 AM
I Need To Be Able To Switch C-states. Help! gacl Linux - Laptop and Netbook 3 06-02-2009 12:19 AM
[SOLVED] LQ Thread states traene LQ Suggestions & Feedback 5 09-09-2007 02:52 AM
Moving to the states! Sava General 17 06-24-2005 08:45 AM
thread states klocko316 Linux - Newbie 1 09-12-2004 05:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:38 AM.

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
Open Source Consulting | Domain Registration