1, the process is the execution of the program, will be loaded into memory, each process includes the code and data of the program, including the data of the program variables, external data, program stack.
2, Linux, the input command, such as VI main.c through the shell to execute, will establish a new process to run it.
3, multiple for can run the same program at the same time, each user to the operation of the program is a separate process,
4, Linux, a process can start another process, open the Linux system, the top of the process tree is a control process, he is a program named init execution, the process is the ancestor of all user processes. System calls the operating system to the program from the user state to the kernel state.
5, fork () produces a child process, the parent-child process runs concurrently, starting from the creation, where the same child process variables have the same variables as the creation process. Linux can be used to provide inter-process communication mechanisms (signals and pipelines), so that the parent process and the child process to complete the different tasks related to each other to achieve multi-tasking.
6, exec start a process, the shell itself is to use the exec to start the process, if the exec call succeeds, the process will be overwritten, and then start from the new program portal execution, the PC is pointing to the execution of the statement, which produced a new process, the process identifier and the calling process is the same, Instead of creating a new process that is concurrent with the calling process, it replaces the original process with a new process, the original process does not run, and the system () function runs.
Linux process creation