I. Introduction to fork
A process, including code, data, and resources allocated to the process. The fork () function creates a process that is almost identical to the original process through system calls, that is, the two processes can do
When a thread calls a function fork, the entire process address space is copied to the child process, Copy-on-write is mentioned in section 8.3. A child process is a process that is completely different from the parent process, but if neither the
In Unix systems, the only way to create a new process is to call the fork system. The process called fork is called the parent process, and the newly created process is called the child process. Syntax format of system call:
PID = fork ();
When
(1) Fork system call DescriptionThe fork system call is used to create a new process from an existing process called a child process, and the original process is called the parent process. The fork is called once, returned two times, and the two
definition
Binary tree is a finite set of n (n>=0) nodes, which is an empty set called an empty binary tree, or has a root node and two separate left child trees and right child trees, called root nodes, which are disjoint.
two
Lien0000342014-10-07
In the process control trilogy, we learned that fork is the first part of the trilogy to create a new process. However, we haven't covered much more in-depth information about fork, such as the relationship between new processes
Fork that little thing Fork Summary
Fork () Creates a new process by copying the calling process. Under Linux, fork () is implemented by using a write-time copy page, so its only disadvantage is that it replicates the time and memory of the parent
What if we wanted to call 1 shell scripts or execute 1 Bash shell commands when we were writing 1 C programs?
In fact, the header file contains 1 function system () that calls the shell command or script, and it is convenient to simply pass the
The only way to create a new process in Linux is to use the fork () function. The fork () function is a very important function in Linux, and there are some differences from previous functions, because the fork () function looks like it executes
Fork,vfork,cloneUNIX standard replication process system calls fork (that is, fork), but Linux,bsd and other operating systems do not only implement this one, specifically, the Linux implementation of three, Fork,vfork,clone (specifically Vfork
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.