1. Creation of Processes
Create a process can be created with fork (), the child process copies the various segments of the parent process (text segment, data segment, stack, heap), the child process can independently modify these memory segments, in addition to the text segment (both shared, can not be modified by the quilt process).
The virtual address of the parent and child is the same, but when mapped to physical memory, a piece of space is created for the child process, which can modify the space independently.
The process created with fork (). The order in which the child process and the parent process executes is not necessarily a scheduler decision.
A process created with vfork () guarantees that the child process executes first. and Vfork () parent-child processes share data segments.
Fork () Create process diagram:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7E/B4/wKiom1cHYMXxDZX3AABBFPEuzTQ718.png "title=" Sub. png " alt= "Wkiom1chymxxdzx3aabbfpeuztq718.png"/>
This article is from the "Output Diamond pattern" blog, so be sure to keep this source http://10541571.blog.51cto.com/10531571/1761781
Linux Process Creation