Re: [gentoo-user] ps command

2008-07-24 Thread b.n.

Etaoin Shrdlu ha scritto:
 > From what I know, "blocked" is the same as "sleeping", ie waiting for
something to happen. Tasks that have completed their time slice and are 
forced by the scheduler to stop, are not "sleeping"; they are 
re-inserted in the queue of the runnable processes, and the scheduler 
picks them up again from there when another time slice is assigned to 
them. These processes are in the "runnable" or "ready" state.


But of course I may be wrong, so corrections welcome.


Thanks, the wikipedia article is very clear.

m.





Re: [gentoo-user] ps command

2008-07-24 Thread Etaoin Shrdlu
On Thursday 24 July 2008, 17:09, Alan McKinnon wrote:

> > What does it mean a process is "sleeping", technically?
>
> It's a misnomer, it means "not running".
>
> The cpu gives the illusion of executing many tasks simultaneously. In
> reality, it is executing them one at a time and very rapidly (many
> times a second) switching between them.
>
> Normally at a given instant in time, one task is running per cpu. The
> rest are mostly waiting their turn or sleeping. There are various OS
> strategies for bringing this about - some rely on the task itself to
> back out after a running for a short while, sometimes the OS kernel
> enforces it, sometimes you have a combination. If everything is
> working nicely, the end result is pretty much the same.
>
> There's another state worthy of note - blocked. This is when a task is
> waiting for something else to happen first (most often disk or network
> I/O) so it won't try and execute till that other thing happens. This
> is not the same as sleeping. Sleeping is spinning you wheels in idle,
> blocked is a deliberate stop and sit back and wait.

From what I know, "blocked" is the same as "sleeping", ie waiting for 
something to happen. Tasks that have completed their time slice and are 
forced by the scheduler to stop, are not "sleeping"; they are 
re-inserted in the queue of the runnable processes, and the scheduler 
picks them up again from there when another time slice is assigned to 
them. These processes are in the "runnable" or "ready" state.

But of course I may be wrong, so corrections welcome.



Re: [gentoo-user] ps command

2008-07-24 Thread Alan McKinnon
On Thursday 24 July 2008, b.n. wrote:

>
> I jump here to relief my everlasting UNIX ignorance.
>
> What does it mean a process is "sleeping", technically?

It's a misnomer, it means "not running".

The cpu gives the illusion of executing many tasks simultaneously. In 
reality, it is executing them one at a time and very rapidly (many 
times a second) switching between them.

Normally at a given instant in time, one task is running per cpu. The 
rest are mostly waiting their turn or sleeping. There are various OS 
strategies for bringing this about - some rely on the task itself to 
back out after a running for a short while, sometimes the OS kernel 
enforces it, sometimes you have a combination. If everything is working 
nicely, the end result is pretty much the same.

There's another state worthy of note - blocked. This is when a task is 
waiting for something else to happen first (most often disk or network 
I/O) so it won't try and execute till that other thing happens. This is 
not the same as sleeping. Sleeping is spinning you wheels in idle, 
blocked is a deliberate stop and sit back and wait.

hth

alan


-- 
Alan McKinnon
alan dot mckinnon at gmail dot com




Re: [gentoo-user] ps command

2008-07-24 Thread Etaoin Shrdlu
On Thursday 24 July 2008, 12:41, b.n. wrote:

> > S means sleeping
> > R means running or runnable
> >
> > s means the process is a session leader
> > + means the process is running in the foreground
>
> I jump here to relief my everlasting UNIX ignorance.
>
> What does it mean a process is "sleeping", technically?

See http://en.wikipedia.org/wiki/Process_states



Re: [gentoo-user] ps command

2008-07-24 Thread b.n.

Alan McKinnon ha scritto:
On Wed, Jul 23, 2008 at 10:09 AM, Kaushal Shriyan 
<[EMAIL PROTECTED] > wrote:


Hi

# ps auxw | egrep "USER|rsync"

root  5301  0.0  0.0  10036  1280 ?Ss   01:13
root  5306  0.2  0.1  56212 31912 pts/0S+   01:14
root  5307  0.0  0.1  38052 29708 pts/0S+   01:14
root  5308  0.2  0.1  38312 29672 pts/0S+   01:18
root  5473  0.0  0.0   2660   592 ttyS1R+

what does Ss and S+ and R+ mean in stat column in ps command


man ps, section "PROCESS STATE CODES"

Briefly,

S means sleeping
R means running or runnable

s means the process is a session leader
+ means the process is running in the foreground


I jump here to relief my everlasting UNIX ignorance.

What does it mean a process is "sleeping", technically?

m.



Re: [gentoo-user] ps command

2008-07-23 Thread Alan McKinnon
On Wed, Jul 23, 2008 at 10:09 AM, Kaushal Shriyan <[EMAIL PROTECTED]>
wrote:

> Hi
>
> # ps auxw | egrep "USER|rsync"
>
> root  5301  0.0  0.0  10036  1280 ?Ss   01:13
> root  5306  0.2  0.1  56212 31912 pts/0S+   01:14
> root  5307  0.0  0.1  38052 29708 pts/0S+   01:14
> root  5308  0.2  0.1  38312 29672 pts/0S+   01:18
> root  5473  0.0  0.0   2660   592 ttyS1R+
>
> what does Ss and S+ and R+ mean in stat column in ps command
>

man ps, section "PROCESS STATE CODES"

Briefly,

S means sleeping
R means running or runnable

s means the process is a session leader
+ means the process is running in the foreground

Is that enough, or do you need more explanation?


--
Alan McKinnon
[EMAIL PROTECTED]


Re: [gentoo-user] ps command

2008-07-23 Thread Neil Bothwick
On Wed, 23 Jul 2008 10:18:57 +0200, Pintér Tibor wrote:

> man ps

Top posting ignorance and RTFM rudeness in only six characters, how
concise!


-- 
Neil Bothwick

new oxymoron: final beta


signature.asc
Description: PGP signature


Re: [gentoo-user] ps command

2008-07-23 Thread Pintér Tibor

man ps

t

Kaushal Shriyan wrote:

Hi

# ps auxw | egrep "USER|rsync"

root  5301  0.0  0.0  10036  1280 ?Ss   01:13
root  5306  0.2  0.1  56212 31912 pts/0S+   01:14
root  5307  0.0  0.1  38052 29708 pts/0S+   01:14
root  5308  0.2  0.1  38312 29672 pts/0S+   01:18
root  5473  0.0  0.0   2660   592 ttyS1R+

what does Ss and S+ and R+ mean in stat column in ps command

Thanks and Regards

Kaushal






[gentoo-user] ps command

2008-07-23 Thread Kaushal Shriyan
Hi

# ps auxw | egrep "USER|rsync"

root  5301  0.0  0.0  10036  1280 ?Ss   01:13
root  5306  0.2  0.1  56212 31912 pts/0S+   01:14
root  5307  0.0  0.1  38052 29708 pts/0S+   01:14
root  5308  0.2  0.1  38312 29672 pts/0S+   01:18
root  5473  0.0  0.0   2660   592 ttyS1R+

what does Ss and S+ and R+ mean in stat column in ps command

Thanks and Regards

Kaushal