What is a zombie process ?First the kernel releases all the stores used by the terminating process (called the exit system call), closes all open files, and so on, but the kernel holds a certain amount of information for each terminating child
What is a zombie process ?First the kernel releases all the stores used by the terminating process (called the exit system call), closes all open files, and so on, but the kernel holds a certain amount of information for each terminating child
Often confusing two signals are SIGCLD and SIGCHLD, the signal SIGCLD originated from system V, the meaning of the signal and from the BSD signal sigchld inconsistent. The posix.1 signal is also known as SIGCHLD. The semantics of the signal sigchld
The two signals that are often obfuscated are sigcld and sigchld. The signal sigcld is derived from System V. The meaning of the signal is different from that of the signal sigchld originating from BSD. Posix.1 signal is also called sigchld. the
Why sigchld (sigchld, sig_dfl) is usually used in the program to execute the system function, the sigchld signal should be displayed: Signal (sigchld, sig_dfl), because in the system function, used fork (), waitpid. if the parent process ignores the
When the process terminates in Linux, the kernel sends a SIGCHLD signal to the parent process with several features:
1. During the operation of a signal processing function, the signal being submitted is blocked.
2. If a signal is
For multiple processes, the parent process generally needs to track the exit status of the child process. Therefore, when the child process ends running, the kernel does not immediately release the table entries for the process table of the session.
The role of ignore sigchld signal-preventing the generation of zombie Processes
Signal (sigchld, sig_igr); // ignores sigchld signals, which is commonly used as a technique for concurrent server performance.// Because the concurrent server often
The following error logs are displayed in the system logs of a Linux machine:
Kernel: Application BUG:ProgramName (row number) has sigchld set to sig_ign but callwait ()
Generally, the sigchld signal is the signal sent by the kernel to the parent
We do not want to retain zombie processes because they occupy the kernel space and eventually lead to depletion of the city's resources. To prevent sub-processes from becoming botnets, all sub-processes generated by fork must be wait.
# Include "
# Include # include # include # include # include int main (INT argc, char ** argv) {sigchld (sig_ign); int ID; id = fork (); If (ID 0) {printf ("I'm in parent process % d \ n ", getpid (); sleep (60);} // signal (sigchld, Sig_ign); Return 0;}
Linux Environment interprocess Communication (V): Shared memory (bottom)In the shared memory (above), mainly around the system call Mmap () for discussion, this section will discuss the System V shared memory, and through the comparison of
Sigchild is only a signal value sent to the parent process when the child process exits. This is a way to asynchronously notify the parent process. the parent process can capture and ignore this signal. The default action is to ignore this signal.
Overview
This article mainly describes the process of Linux under the relevant operations, and later will write an article on the Linux thread operation. These two articles and I have to finish an article (IPC communication under Linux) to form a
1. What is a zombie process?
The zombie, defunct, PS, and top commands of zombie processes can be seen. It refers to a process in the "zombie" state. Such a process is dead, but it is still stored in some way. It is said that it has died because
Once, it was tortured by the system () function, because the system () function was not well understood. Simply knowing that using this function to execute a system command is not enough, it is not sufficient, its return value, the return value of
1. Signal pending and blocking"Signal status:
The "pending" Status of the signal refers to the period from the generation of the signal to the time before the signal is processed. The "blocking" Status of the signal is a switching action, it
These days tuning program (embedded Linux), the discovery program sometimes inexplicably die, each time is located in the program in the different system () function, directly under the shell Input system () function called in the command is also
Once, it was tortured by the system () function, because the system () function was not well understood. Simply knowing that using this function to execute a system command is not enough, it is not sufficient, its return value, the return value of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.