Problem of child process splitting parent process time slice

Source: Internet
Author: User

Read a paragraph in this book:

In kernel 2.6, the calculation of the time slice is decentralized, the specific calculation time can be Task_timeslice (), or other methods can be used.

A. When a process is created, halve the time slice of the parent process to the child process, while the time slice of the parent process is halved.

B. After the process runs out of time slices, the time slice needs to be recalculated and the process inserted into the appropriate run queue.

C. When a process exits, it determines whether to return the child process's time slice to the parent process, based on the value of the First_timeslice.

Question: For a, the child process's time slice is divided from the parent process, that is, the parent process also has time to complete the task of the child process, then simply do not need to create a subprocess. The child process is divided into the time slice of the parent process, so how to create a process can increase the parallelism of the machine.

For B, does this "recalculate time slice" get rid of the limitation of the time slice that the child process has from the parent process, and whether the time slice of the parent-child process still has some kind of relationship.

For multi-core machines, what is the time slice division of the subprocess and the parent process? How to coordinate the length of time slices between multi-core.

I hope Daniel can give some hints ...

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.