11-05-2001
The algorithm for allocating process IDs differs by type of OS. Some OS types allocate in sequential order up to 32,000 and then start over at the beginning using free slots. Others, namely AIX, will reuse PIDs as they are freed. Regardless of how the PID is allocated, the PID is actually an index into the Process Table in the Kernel which is an array of structures of type proc (see /usr/include/sys/proc.h). If the process is runnable, active, or in a zombie state, the slot in the process table is marked as full. When the process dies and is successfully cleaned up, the slot is available for allocation by the dispatcher when a new process is started. So, to summarize, PIDs are unique in all types of UNIX.
This User Gave Thanks to wizard For This Post:
10 More Discussions You Might Find Interesting
1. Programming
I have written a program to collect some performance metrics on and AIX box, but I'm having difficultly getting the process information.
I'm lead to believe that I'm not getting the correct information because I'm trying to run the program on AIX 5.1 (5100-03), but I'm not convinced as the... (0 Replies)
Discussion started by: StuBob
0 Replies
2. Shell Programming and Scripting
Hi Friends :p
I have a little problem please help me out. I have a Unix based OS Sun Server having oracle 8i as database on it. The server has one client with windows OS. The client uses developer 2000 (GUI) to run query and run processes. I want to know how can I know the PID of a process run... (3 Replies)
Discussion started by: vanand420
3 Replies
3. Solaris
hi all,
Is there a simple script anyone could through out to me, to find the pid of a process given the name. I actually need to bind this pid to a processor set. I would probably put these comamns in a shell script which would have.
a) kick start the executable
b) get the pid
c) bind it to a... (10 Replies)
Discussion started by: Naanu
10 Replies
4. Linux
I am trying to submit a background process on a remote machine using
ssh -f remote-host "sh my-process.sh"
Normally the process will be submitted and control returned to the local machine (even when the process is running on the remote machine)
I want to get the process id of the submitted... (4 Replies)
Discussion started by: superuser84
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this.
Thanks in advance,
Amudha (7 Replies)
Discussion started by: samudha
7 Replies
6. Shell Programming and Scripting
Hi
I have written a shell script to find and kill the particular process. Here in shell script i have written the code like
cnt = $(ps -ef | grep Shree)
echo $cnt
I am getting the output
root 2326 2317 0 14:39:46 pts/1 0:28 Shree -f fdc.fbconf FDCapp.fbapp
Here I want to... (2 Replies)
Discussion started by: Shreedhar Naik
2 Replies
7. Shell Programming and Scripting
Hi all,
i was able to redirect pid of process to a file in the following way
ps aux|awk '$11 == "/Applications/ProjectX/DServer" >> /Applications/ProjectX/DServer.pid
it works fine but if one folder name caontains space its not working like below
ps aux|awk '$11 == "/Applications/Project\... (1 Reply)
Discussion started by: kirankumars
1 Replies
8. Programming
Hi
I use linux OS.
I've already written a function that allow me to get the process name by pid. (searching in /proc). Now I'd like to perform the inverse task.I mean get the process pid by its name.
I could write a function that search in every folder in /proc for the process name, but i... (2 Replies)
Discussion started by: Dedalus
2 Replies
9. AIX
Hi
I would like to know more about swapper process..
I knew that swapper is the first process with PID#0, used to perform process swap operations. It used to swap entire processes
But sometimes I find swapper process with PID#264
So my doubt is how many swapper process can exist in a system?... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
10. AIX
HI,
i used
ps -ef | grep 3539052 | grep -v grep
and i got a output like ths
root 3539052 3407918 0 May 07 - 709:31 /usr/sbin/syslogd
but what i need is instead of full path /usr/sbin/syslogd i want only the process name that is 'syslogd' here. (3 Replies)
Discussion started by: sumanthupar
3 Replies
LEARN ABOUT HPUX
process_id_min
process_id_min(5) File Formats Manual process_id_min(5)
NAME
process_id_min - specify a minimum value for process IDs (PIDs)
VALUES
Failsafe
Default
Minimum
Maximum
must be less than or equal to If the difference between and inclusive is less than is effectively limited to this difference.
DESCRIPTION
The tunable specifies the minimum process ID (PID) value to generate for new processes. It allows application developers to duplicate an
environment where PID values are large for the purpose of software validation.
This tunable is primarily intended for development environments.
Who is Expected to Change This Tunable?
Anyone interested in software program validation in an environment where PIDs have large values.
Restrictions on Changing
Changes to the tunable are effective immediately. However, any existing processes and their PIDs are not changed.
It is recommended that the system be rebooted after specifying this tunable so that all PIDs in the system will have values in the selected
range.
When Should the Value of This Tunable Be Raised?
Raise this tunable to validate software for tolerance of large PID values in a development environment.
What Are the Side Effects of Raising the Value?
If the difference between and is less than the number of processes allowed to exist simultaneously will be lower than the value of
When Should the Value of This Tunable Be Lowered?
Lower this tunable when the system is meant to be moved from a development to a production environment.
What Are the Side Effects of Lowering the Value?
If the difference between and is less than the number of processes allowed to exist simultaneously will be lower than the value of
What Other Tunable Values Should Be Changed at the Same Time?
It may be desirable to change The tunable should, ideally, be set for the maximum value when validating software which uses PIDs. When
changing it is recommended that the system be rebooted to ensure all processes have PIDs within the desired range.
WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of
HP-UX.
The HP-UX kernel may silently round the selected values for and/or (for example, to the nearest power of 2) in order to accommodate the PID
generation algorithm.
It is recommended that validation of software be carried out with the largest configurable value (1,073,741,567) for the tunable, in con-
junction with the tunable set to something of the same magnitude (for example, 1,000,000,000).
The manpage for (see process_id_max(5)) should be consulted for information about potential application issues with large PID values.
Because session IDs (SIDs) and process group IDs (PGIDs) are the same as the process ID of the session or group leader, an increase in the
minimum PID also increases the minimum SID and PGID.
The system may assign process ID values less than to certain special system processes.
Booting the system with set to a non-zero value may cause the initialization process (aka init) to have a PID of something other than 1.
However, most system utilities and commands will, by default, report the value of the initialization process's PID as 1. For example,
returns 1 if the caller's parent is the initialization process, regardless of its actual PID.
Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation,
some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun-
able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was
factory installed on your system, see at
AUTHOR
was developed by HP.
SEE ALSO
init(1M), fork(2), getppid(2), nproc(5), process_id_max(5).
whitepaper, available on
Tunable Kernel Parameters process_id_min(5)