A process is a program that runs. There are two ways to execute another procedure in one program: 1) system executes the program in the Shell 2) fork + exec replicates a process that replaces the existing program fork with a new program in the process to copy the currently executing process. A process becomes two processes. Judging by the return value of the function is in that process. The PID of the child process is returned in the parent process. exec replaces the currently executing program with a new program. The wait parent process waits for the (block) child process to end. Nice adjusts the niceness of the process, and the positive number is the priority of reducing process scheduling. Signal is an asynchronous communication mechanism. After the process receives the signal, interrupts the current processing and executes the signal processing function. Process, you can register the handler of the signal. Common signals: SIGTERM SIGKILL SIGABRT SIGUSR1 where SIGKILL cannot be ignored in the process. After the zombie process subprocess finishes executing, the parent process obtains the end information for the child process by calling wait. If there is no parent process to wait, the end state information for the child process remains until it is cleaned up by the init process. This consumes the resources of the system. Ways to clean up the zombie: 1) through WAIT3, WAIT4 polling 2) processes the child process complete signal in the parent process date:2014.11.5
Linux Programming Learning notes-Process