On hpux

ps -efl

I see on output the letter S,which mean "state of process" I see voices like S(sleeping) and W(waiting) I know(hope is correct) Sleeping mean "waiting for event",but what does it mean Waiting? My doubt is:

S=Sleeping OK

From the book HP-UX: HP Certified Systems Administrator 11i v3 by Asghar Ghori (paraphrased):

  • the running state indicates the processor is currently being executed by a system CPU
  • the sleeping state shows that the process is waiting for input
  • the waiting state the process is ready to run as its turn arrives


In other words, in a system with just a single CPU core, only one process at a time can be in the Running state, and all the others that could possibly be Running are Waiting instead.

And because you'll need to run a process to get the process information, on a single-core system you may only ever see the process that is running the ps command or similar process information tool in the R state. Only on a system with 2 or more CPU cores you will be able to see other processes in the R state, while your process is running to get the process information.

So, in human timescales, the R and W states are actually essentially equivalent: between the time the process information is received from the kernel and the time a human has read the display on the screen and understood it, several of the processes in the W state may have had their turn on the processor (= in the R state) and returned to the W state to wait for another turn.

All the process states are "OK" in some situations. For example, even the Z state (Terminated, or "zombie") is OK unless a process stays in that state for a long time; if so, then it's a symptom of the parent process having some problem so that it cannot/will not read the exit code of its own child process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.