Fundamentals of the ten-year OPS series-Linux
Zeng Lin
Contact: [Email protected]
Website: www.jplatformx.com
Copyright: Please do not reprint the article without permission
First, Introduction
Modern operating systems typically support multi-tasking (multitasking). Multitasking refers to the simultaneous execution of multiple tasks by quickly switching between running programs. The Linux kernel manages multiple tasks by using processes. A process is a form of organization that Linux uses to schedule different programs to wait for CPU scheduling.
Ii. How the process works
When the system starts, the kernel first initializes some of its programs to the process, and then runs a program that becomes init. The INIT program will run a series of shell scripts called script initialization (placed in the/etc directory), which will start all system services. Many of these services are implemented through the Daemon (daemon program). and backstage programs just stay in the background and do their own thing, and there's no user interface. Therefore, even if no user is logged in, the system is busy executing some routines.
Running a program can trigger other programs to run, and in a process system such a situation is expressed as a parent process that creates a child process.
The kernel saves the information for each process to ensure that the task is in order. For example, each process will be assigned a number called the process ID (PID). Process IDs are allocated in ascending order, and the PID of the INIT process is always 1. The kernel also records the memory information assigned to each process and the process readiness information used to recover the run. Similar to the file system, there are owners, user IDs, valid user IDs, and so on in the process system.
(013) The process of Linux