Four ways to deal with an interview----zombie process

Source: Internet
Author: User

L The parent process waits for the child process to end through functions such as wait and waitpid, which causes the parent process to hang

If the parent process is busy, you can use the signal function to install handler for SIGCHLD, because the parent process will receive the signal when the child process ends, and you can call the wait recycle in handler

L If the parent process does not care about when the child process ends, it can use signal (SIGCHLD, Sig_ign) to notify the kernel that it is not interested in the end of the child process, and then the kernel recycles and no longer sends a signal to the parent process.

L also have some skills, that is, fork two times, the parent process fork a child process, and then continue to work, the child process fork a grandchild process exit, then the Sun process is init takeover, after the sun process, init will be recycled. But the recycling of the sub-process to do it yourself.

Four ways to deal with an interview----zombie process

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.