Linux job switchover-general Linux technology-Linux programming and kernel information. The following is a detailed description. (1) task switching is implemented by calling the schedule () function. It first detects alarm (timed value of process alarms) and wakes up any interrupted tasks with signals. Then, process the last task in the task array cyclically and skip the array slot without tasks. Compare the counter values of each ready state task and select the maximum task, or if no running task exists in the system, select Task 0. Then switch_to () is called to switch to the selected task. If a task can be run but the counter value is 0, the counter value of each task is updated based on the priority value of each task, and then compared and selected again.
(2) switch_to (n) switches the current task to task n. First, check whether Task n is the current task. If yes, do nothing and exit. Otherwise, the task is switched to the TSS segment selection operator, which causes the task to switch to the process corresponding to the TSS. the TSS of each process corresponds to the task [] array where its process number is located.
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