The process scheduling algorithm commonly used in operating system __ algorithm

Source: Internet
Author: User
Tags joins

First , to first serve

The simplest scheduling algorithm is first come first service (FCFS), also known as FIFO (FIRST-IN-FIRST-OUT,FIFO) or strict queuing scheme. When each process is ready, it joins the ready queue. When the currently running process stops executing, select the longest-running process in the ready queue.


second, the rotation method

This is a clock based preemption strategy that generates a clock interrupt at a periodic interval, when the interrupt occurs, the currently running process is placed in the ready queue, and the next ready job is selected based on the FCFS policy. This technique is also called a time slice, because each process is given a time before it is preempted.


third, the shortest process priority

The shortest process first (NEXT,SPN) policy, which is a non preemption policy, is the principle of the next time you select the process with the shortest processing time, so the short process will jump over the long job to the queue header.


Four, the shortest remaining time

The shortest remaining time (shortest Remaining time,srt) is a version of the preemption mechanism that is added to the SPN. In this case, the scheduler always chooses the process with the shortest expected remaining time. When a process joins the ready queue, it may have a shorter remaining time than the currently running process, so as long as the new process is ready, the scheduler may preempt the currently running process. Like the SPN, the scheduler must have an estimate of the processing time when executing the selection function, and there is a risk of long process starvation.


v. Highest response ratio priority

According to the ratio: r= (w+s)/s (R is the response ratio, W is the time waiting to be processed, S. is the expected service time)

If the process is called immediately, the R value is equal to the normalized turnaround time (ratio of turnaround time and service time). The R minimum value is 1.0, and only the first process that enters the system can achieve this value.

The scheduling rule is: When the current process completes or is blocked, select the maximum ready process for the R value, which illustrates the age of the process. When the short work, the long process due to lack of service, waiting time to increase, thereby increasing the ratio, and finally won the competition in the short process.

As with STR,SPN, using the maximum response ratio (HRRN) strategy requires estimating the estimated service time.


Vi. Feedback Method

If there is no information about the relative length of each process, neither SPN,SRT nor HRRN can be used. Another way to make a biased short job is to penalize a long-running job, in other words, if you can't get the rest of the execution time, focus on the time that has been performed.

The method is: scheduling based on preemption principle (by Time slice) and using dynamic priority mechanism. When a process enters the system for the first time, it is placed in a priority queue, and when it is first preempted and returned to the ready state, it is placed in the next low-priority queue, which is demoted to the next low-priority queue whenever it is preempted in the subsequent time. A short process will soon run out, not to drop many levels in the ready queue, and a long process will gradually degrade. New processes and short processes therefore take precedence over the old processes and the long processes. In each queue, in addition to the lowest priority queue, is a simple FCFS mechanism, once a process in the lowest priority queue, it can not be demoted, but will be repeated back to the queue, know the end of the run. Therefore, the queue can be scheduled in a rotational fashion.


the characteristics of various scheduling algorithms


Reference operation operating system essence and Design Principle (seventh edition)

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.