Process---in linux analysis of Fork, vfork, exec function family, process exit mode, etc.

Source: Internet
Author: User

Fork and Vfork Analysis:

Before the fork has implemented copy on write, the UNIX designer is concerned about the wasted address space caused by exec immediately after the fork, that is, the efficiency problem when copying the process address space, so the introduction of vfork system calls.

Vfork has a limit, the child process must immediately execute the _exit or EXEC function.

Even if the fork implemented copy on write, the efficiency is not vfork high, but now it is not recommended to use vfork, because almost every vfork implementation, there are more or less a certain problem.

Fork: The child process copies the data segment of the parent process; Vfork: The child process shares the data segment with the parent process.

Fork: The execution order of the parent-child process is indeterminate; Vfork: The child process runs first and then runs after the parent process.

Process---in linux analysis of Fork, vfork, exec function family, process exit mode, etc.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.