When a SIGSTOP signal is sent to the process, it enters the TASK_STOPPED state in response to the signal (unless the process itself is in the TASK_UNINTERRUPTIBLE state and does not respond to the signal). (SIGSTOP, like the SIGKILL signal, is very mandatory. The user process is not allowed to reset the corresponding signal handler function via the system call of the signal series.) Sending a SIGCONT signal to the process allows it to return from the TASK_STOPPED state to the TASK_RUNNING state. The parent process can wait for the exit of one or some child processes through the system calls of the wait series (such as wait4, waitid), and get its exit information. Then the system call of the wait series will release the child process's corpse (task_struct). In the process of exiting the child process, the kernel will send a signal to its parent process to inform the parent process to "collect the corpse". This signal defaults to SIGCHLD, but this signal can be set when a child process is created via the clone system call. The following code can be used to create an EXIT_ZOMBIE state process: With ps -aux you will see the following zombie Process information. As long as the parent process does not exit, the child process of this zombie state will always exist. Then if the parent process quits, who will come to the child process & ldquo; corpse & rdquo;? When a process exits, it will host all its child processes to other processes (making it a child of another process). Who is it for? It may be the next process (if it exists) of the process group in which the process is exiting, or the process No. 1. So every process, every moment, there is a parent process. Unless it is the number 1 process. 1. /The root partition is a mandatory partition, partitioned according to your actual situation. 2. Nginx starts with version 0.7.48 and supports Squid-like caching. This cache uses the URL and relate Basic principle After the mysql installation is successful, the default is to not open the remote a Introduction to Soft InterruptsInsert processing that can be deferred from the hard interrupt handl Explain in detail the practical security of home Linux In the future, Linux wants to put Flash in Chrome Linux operating system crash processing method summary Squid log file is too large, how to deal with it? Under Linux. a/.so/.la target library difference Desktop application: special effects photos under Linux system are also wonderful How does the Linux system change face Win8 Linux system Win8 skin centOS automatically installs php Linux vmware tools under VMware Workstation VM Linux system installation php extension cURL How to set up window animation slowdown in Win10 system? Windows2003 IIS can not specify IP The meaning of Windows 7 blue screen Windows Server 2003 Group Policy Troubleshooting Six Methods Win8 system broadband connection automatic connection setting diagram Win7 can't open chm file solution tutorial
As shown in the above figure, we did not consider the contents mentioned in the figure when actually coding, but the things shown in the above figure are the key to understanding the parent process and the child process. Regarding many problems of the process, we also think about starting from the above diagram. Later, I will specifically ask a few questions to analyze why the process memory image is so important.
Process scheduling
On a single processor, only one process can run at a time, and other processes are waiting to run. However, our actual feeling is that there are multiple processes at the same time at the same time & rdquo; running, why is this?
Operating system
will give each process a certain running time, called time slice”. The process runs in this "time slice", because the "time slice" is very short, which gives the illusion that multiple programs are running at the same time. How does the operating system
schedule the process? There are many rules for process scheduling, such as scheduling algorithms based on priority, FIFO scheduling algorithms, and so on.
The Linux kernel process scheduler schedules processes based on the priority of the process. Processes with higher priority run more frequently.
Process Status
There are five states on Linux:
When we use the ps -aux command What do the letters that identify the process mean when looking at the process state? The character identifier of the specific process state is shown in the following table: state flag
state description
D non-interruptible R run S interrupt T stop Z zombie
but Sometimes, we will see some other identifiers, for example: state flags
state description
W zombie< high priority process N low priority Level process L memory lock page
See above is interrupted, can not be interrupted, stop, zombie, directly dizzy, then how to understand these concepts?
if (fork()) while(1) sleep(100);