Process encapsulation of Lilin apue

Source: Internet
Author: User

1. A child process is a copy of the parent process. It obtains the data space/Heap/stack of the parent process, and the parent and child processes share the code segment. the child process starts to run after fork. The returned value = 0 indicates the child process, because the child process can obtain the ID of the parent process through the function, but the parent process cannot know the ID of the child process.

2. to improve the submission efficiency, fork does not immediately copy the space of the parent process, but uses the cow technology, that is, when the parent process or child process needs to modify the data segment/Heap/stack, the replication operation is performed and the modified region is copied.

3. The file descriptor copied by the sub-process from the parent process. It points to the same file object as the parent process, that is, the file offset/flag is shared.

4. the difference between without-lpthread and locking blocking of mutex is caused by the selection of strong and weak symbols and dynamic link libraries during the link, for details, refer to the Problem description and solution: Click the open link.

Process encapsulation of Lilin apue

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.