The process table is a kernel data structure that keeps records of all processes in memory. Each process has information associated with it that resides in the process table. You can use the ps command to list process attributes in tabular form containing different fields. Some of the fields in the process are shown in Table 20-1.
Field | Description |
---|---|
PID | Process ID |
PPID | Process ID of the parent |
STAT | Current process state |
UID | User who created the process |
GID | Group ID of the owner |
C or CPU | Processor utilization |
PRI | Priority of the process |
NI | Nice value used in the priority calculation |
ADDR | The memory address of the process |
SZ | Size in physical pages of the process image |
WCHAN | Event for which the process is waiting |
STIME | Starting time of the process |
TTY | Controlling terminal of the process |
TIME | Cumulative execution time of the process |
COMM | The command that started the process |
MAX | Maximum number of open files allowed |
At system startup, the swapper process is created that has a process ID of 0. The swapper process initiates the init process that has a PID of 1. The init process is then responsible for creating other processes using the fork system call.
The kernel has a scheduling mechanism used to determine which process will be executed during a given time slice. The state of a process is represented by a process context that contains information about process data and register values. When a time slice for a process is finished, its context is saved, and the next process is started.
Top |