Unix process states


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Unix process states
# 1  
Old 02-21-2012
Question Unix process states

I am trying to write my own Unix compliant (SUSv4) OS - Just a hobby OS, nothing serious. While going through the standard, I couldn't find any explicit information on process states. What I could find was (excluding the real-time considerations)-

Quote:
# 3.444 Zombie Process
A process that has terminated and that is deleted when its exit status has been reported to another process which is waiting for that process to terminate.

#4.1.4 Scheduling Policy
A scheduling policy affects process or thread ordering:
- When a process or thread is a running thread and it becomes a blocked thread
- When a process or thread is a running thread and it becomes a preempted thread
- When a process or thread is a blocked thread and it becomes a runnable thread
- When a running thread calls a function that can change the priority or scheduling policy of a process or thread
- In other scheduling policy-defined circumstances
From this it can be inferred that the following process states might exist-
RUNNING, BLOCKED, PREEMPTED, RUNNABLE, ZOMBIE

I was wondering whether the Unix specification gives something more detailed?

If not, does any implementation of the above criteria meet the specification? Or is there something more?
# 2  
Old 02-21-2012
From "man ps" , a list of the possible values of the "state" field.

0 Nonexistent
S Sleeping
W Waiting
R Running
I Intermediate
Z Terminated
T Stopped
X Growing


You'll probably find a lot of variation.
# 3  
Old 02-22-2012
@methyl

I understand that there are a lot of variations. I was just wondering if the standard specifies / recommends / hints at any particular model.

The Linux man pages do give the above data. However the ps manual from the SUSv4 doesn't really say anything about process states. Checkout http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ps command showing different states for same process

I am using HP-UX,KSH $ jobs -l + 19377 Running nohup ksh cat_Duplicate_Records_Removal.ksh </dev/null >/dev/null 2>&1 & $ ps -p 19377 -fl F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME COMD 401 S catmgr 19377 19491 ... (1 Reply)
Discussion started by: TomG
1 Replies

2. Hardware

Hyperthreaded virtual cores, different C-States?

turbostat reports C-states of all CPU cores, and includes entries for each hyper-threaded core as well. Often enough the two logical cores on a single physical core will list different C state percentages. Does that make any sense? Is this reporting the c-states of the few duplicated parts... (8 Replies)
Discussion started by: agentrnge
8 Replies

3. Shell Programming and Scripting

Count no of netstat states

netstat | awk '/server/ {for(i=1;i<2;i++) {getline;print}' Output: ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED TIME_WAIT TIME_WAIT From the above command I'm getting all the states. I want to count the states and write to a file, like "Count of ESTABLISHED... (6 Replies)
Discussion started by: Roozo
6 Replies

4. UNIX and Linux Applications

Where can I find UNIX training course in the United States?

Hi guys, Can you help me please to find an appropriate course of UNIX in the United States. Also, can you provide me some information about the schools or institutes that offer it in the U.S. Thanks, (0 Replies)
Discussion started by: Malik Dera
0 Replies

5. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

6. Solaris

meaning of states in sun clusters

Hi Everybody, As I am new to Sun Clusters, Please help me what is "online but not monitored" state of resources and "online - service is online" in status message. Thank you. (1 Reply)
Discussion started by: mayahari
1 Replies

7. Programming

How to get process name from process id in all Unix platforms?

Hi, i need to find the process name using the process id in C. This has to be done in HP, AIX, Solaris & Linux?? How can this be done? Is there any common solution to all platforms? On linux i have heard that /proc/<pid>/cmdline can be used. Is there a structure available to read this? ... (3 Replies)
Discussion started by: molu
3 Replies

8. IP Networking

laymens terms for netstat states

Ok, I've read the manpages on netstat and it gives a good description of the state values such as CLOSE_WAIT, ESTABLISHED, SYN_RECEIVED, etc.. Can someone give me real world situations where you would get these states. LIke for example if I got SYN_RECEIVED what possible situations would be the... (1 Reply)
Discussion started by: eloquent99
1 Replies
Login or Register to Ask a Question