What is the linux process table ? What does it consist of?

Process table is a kernel data structure that describes the state of a process (along with process U Area). It contains fields that must always be available to the kernel.

It contains following fields :

  • state field (that identifies the state of the process)
  • fields that allow kernel to locate the process and its u area in memory
  • UIDs for determining various process privileges
  • PIDs to specify relationships b/w processes (e.g. fork)
  • event descriptor (when the process in sleep state)
  • scheduling parameters to determine the order in which process moves to the states "kernel running" and "user running"
  • signal field for signals send to the process but not yet handled
  • timers that give process execution time in kernel mode and user mode
  • field that gives process size (so that kernel knows how much space to allocate for the process).

In short, process table gives information about processes to the kernel.


The process table in Linux (such as in nearly every other operating system) is simply a data structure in the RAM of a computer. It holds information about the processes that are currently handled by the OS.

This information includes general information about each process

  • process id
  • process owner
  • process priority
  • environment variables for each process
  • the parent process
  • pointers to the executable machine code of a process.

A very important information in the process table is the state in that each process currently is. This information is essential for the OS, because it enables the so called multiprocessing, i.e. the possibility to virtually run several processes on only one processing unit (CPU).

The information whether a process is currently ACTIVE, SLEEPING, RUNNING, etc. is used by the OS in order to handle the execution of processes.

Furthermore there is statistical information such as when was the process RUNNING the last time in order to enable the schedulr of the OS to decide which process should be running next.

So in summary the process table is the central organizational element for the OS to handle all the started processes.

A short introduction can be found in this thread:

https://web.archive.org/web/20190817081256/http://www.linuxforums.org/forum/kernel/42062-use-process-table.html

And wikipedia also has nice information about processes:

http://en.wikipedia.org/wiki/Process_management_(computing)#Process_description_and_control

http://en.wikipedia.org/wiki/Process_table


Each process is represented in the operating system by a process control block - also known as task control block - which contains the following

Process management
Registers
Program counter
Program status word
Stack pointer
Process state
Priority
Scheduling parameters Process ID
Parent process
Process group
Signals
Time when process started CPU time used
Children’s CPU time
Time of next alarm

Memory management
Pointer to text segment info 
Pointer to data segment info 
Pointer to stack segment info


File management
Root directory Working directory File descriptors User ID
Group ID

enter image description here

For more, https://www.technologyuk.net/computing/computer-software/operating-systems/

Tags:

Linux

Process