Operations on Processes
Most systems allow for concurrent process execution and allow for
dynamic process creation and deletion. Therefore, a means for starting
and stopping processes must be provided by these systems. This
section examines the mechanics involved in process generation and
provides examples on UNIX and Windows platforms.
Process Creation
A process may generate numerous additional processes while it is being
executed. As was already indicated, the newly created processes are
referred to as the children of the parent process. Each of these new
processes has the potential to produce further processes, building a
process tree.
The majority of operating systems, including UNIX, Linux, and Windows,
use a unique process identifier (or pid), which is often an integer
number, to identify processes. The pid gives each process in the system
a distinct value, and it can be used as an index to access different
kernel-level properties of a process.
A typical Linux operating system process tree is shown in Figure 3.8,
along with each process' name and pid. (We loosely use the term
"process"; Linux uses the term "task" instead.) All user processes have
the init process as their root parent, which has a pid of 1. The init
process can also create a variety of user processes once the system has
booted, such a web or print server, an ssh server, and others. Kthreadd
and SSH are two of init's offspring that we can see in Figure 3.8.
Additional processes that work on behalf of the kernel are created by
, the kthreadd process (in this situation, khelper and pdflush). Clients
that connect to the system using ssh (short for secure shell) must be
managed by the sshd process. Clients who log in directly to the system
are managed by the login procedure. The bash shell, which has been
given the pid 8416, is being used by a client who has logged in in this
example. This user has written the emacs editor and the process ps
using the bash command-line interface.
We can use the ps command on UNIX and Linux systems to get a list of
processes. For instance, the instruction: ps -el
will provide detailed information for each process that is running at the
moment.
By recursively tracing parent processes all the way to the init process, it
is simple to build a process tree resembling the one in Figure 3.8.
Most systems allow for concurrent process execution and allow for
dynamic process creation and deletion. Therefore, a means for starting
and stopping processes must be provided by these systems. This
section examines the mechanics involved in process generation and
provides examples on UNIX and Windows platforms.
Process Creation
A process may generate numerous additional processes while it is being
executed. As was already indicated, the newly created processes are
referred to as the children of the parent process. Each of these new
processes has the potential to produce further processes, building a
process tree.
The majority of operating systems, including UNIX, Linux, and Windows,
use a unique process identifier (or pid), which is often an integer
number, to identify processes. The pid gives each process in the system
a distinct value, and it can be used as an index to access different
kernel-level properties of a process.
A typical Linux operating system process tree is shown in Figure 3.8,
along with each process' name and pid. (We loosely use the term
"process"; Linux uses the term "task" instead.) All user processes have
the init process as their root parent, which has a pid of 1. The init
process can also create a variety of user processes once the system has
booted, such a web or print server, an ssh server, and others. Kthreadd
and SSH are two of init's offspring that we can see in Figure 3.8.
Additional processes that work on behalf of the kernel are created by
, the kthreadd process (in this situation, khelper and pdflush). Clients
that connect to the system using ssh (short for secure shell) must be
managed by the sshd process. Clients who log in directly to the system
are managed by the login procedure. The bash shell, which has been
given the pid 8416, is being used by a client who has logged in in this
example. This user has written the emacs editor and the process ps
using the bash command-line interface.
We can use the ps command on UNIX and Linux systems to get a list of
processes. For instance, the instruction: ps -el
will provide detailed information for each process that is running at the
moment.
By recursively tracing parent processes all the way to the init process, it
is simple to build a process tree resembling the one in Figure 3.8.