The Linux operating system is intended for multiple users. At the same time, many users can issue various commands to the operating system.
Introduction
The Linux operating system is intended for multiple users. At the same time, many users can issue various commands to the operating system.
How does the operating system implement multi-user environments?
In modern operating systems, there are procedures and processes.
So what is a program and a process?
In general, a program is a file that contains executable code and is a static file.
A process is an instance of a program that starts execution but has not ended. Is the specific implementation of executable files.
A program may have many processes, and each process can have many sub-processes, which are cyclically generated.
After a program is called to the memory by the system, the system allocates certain resources (memory, devices, and so on) to the program, and then performs a series of complex operations to turn the program into a process for the system to call.
In the system, only processes have no programs. to distinguish different processes, the system assigns an ID (like our ID card) to each process for identification.
In order to make full use of resources, the system also classifies processes into five states: New, running, blocking, ready, and complete.
The process is being created.
The running process is running.
Blocking means that the process is waiting for an event.
Ready indicates that the system is waiting for the CPU to execute the command.
Completion indicates that the process has ended and the system is recycling resources.
========================================================== ======
Another way of saying [this is the information found on the internet and I don't know which one is correct]
There are 5 Processes in linux
1. run (running or waiting in the running queue)
2. interruption (in sleep, blocked, waiting for the formation or receipt of a signal of a condition)
3. do not interrupt (do not wake up when receiving the signal or do not run, the process must wait until there is an interruption)
4. Stiff (the process has been terminated, but the process descriptor exists until the parent process calls wait4 () and is released after the system call)
5. stop (the process stops running after receiving signals from SIGSTOP, SIGSTP, SIGTIN, and SIGTOU)
Five status codes used by the PS tool to identify a process
D. uninterruptible sleep (usually IO) cannot be interrupted)
R run runnable (on run queue)
S interrupt sleeping
T stop traced or stopped
Z dead a defunct ("zombie") process