Operating system-CPU Scheduling

Source: Internet
Author: User

Concept

Control and coordinate the competition of multiple processes against the CPU

That is, according to a certain scheduling algorithm to select a process from the ready queue, the use of the CPU to the selected process

Scene

n processes ready, waiting for the upper M (m>=1) CPU to run, need to decide which process is assigned to which CPU to run

Solve

What: Scheduling algorithm (select Next by what principle), when: timing (when to choose), how: Scheduling process (How the selected process is running on the CPU)

Timing: When the kernel returns to the user state after the interrupt/exception/system call is processed (the change in the ready queue causes a reschedule)

If the process terminates gracefully (exits), the process is created as a result of an error termination (such as abort exception), a wait process becomes ready (wakeup), and a process changes from run state to ready state

or blocking state (waiting or interrupting)

Scheduling process: Process switching, one process letting out the CPU, the other consuming CPU, including saving the state of the original process and recovering the state of the new process

Example: Process a CPU, process B on the CPU, the entire process consists of saving the context of a process, modify the status of process a (update PCB), process A to the appropriate queue, the state of B

Set to run State, restore context from PCB in process B

An important concept: context switching overhead

Direct overhead includes CPU time for the kernel to complete the switchover (Save and restore registers, switch address space, etc.)

Overhead includes cache, buffer cache, TLB invalidation

the measurement index of scheduling algorithm

Throughput-the number of processes completed per unit of time

Turnaround time-The time each process has been made from the request to the completion of the run

Response time-from the time the request is made to the first response

CPU utilization--CPU doing effective work more time than the column

Wait time-the time each process waits in the ready queue

Operating system-CPU Scheduling

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.