Common process scheduling algorithm---operating system

Source: Internet
Author: User

Common process scheduling algorithms

Rotation scheduling algorithm (RR), priority scheduling algorithm, multi-queue scheduling algorithm, multi-level feedback queue Scheduling algorithm , guaranteed scheduling algorithm, fair sharing scheduling algorithm .

1 rotation scheduling algorithm (RR)

1 "principle: First come first serve (FIFC) policy into a ready queue. The system can be set to create an interrupt every time, to activate the process scheduler to dispatch, the CPU allocated to the team first process, and let it execute a time slice. When it is finished, the processor is assigned to the new team first process in the ready queue, which also allows it to execute a time slice. This kind, It is guaranteed that all processes in the ready queue will have a time slice of processor time within a defined time period.

(2) Process switching time

In the RR scheduling algorithm, when the process should be switched, there are two kinds of situations:

  first: If a The time slice has not run out of

the second type: in a after the time slice runs out , the timer interrupt handler is activated. If the process has not finished running, the scheduler will send it to the end of the ready queue .

2 priority scheduling algorithm

In the Rotary scheduling algorithm, an implicit hypothesis is made that the urgency of all processes in the system is the same. But this is not the case, in order to meet the needs of the actual situation, the introduction of priority in the process, thus forming the following algorithm---priority scheduling algorithm.

(1) Types of priority scheduling algorithms

The priority process scheduling algorithm is the highest process that assigns the processor to the priority in the ready queue. At this point, the algorithm can be further divided into the following two kinds:

    First: non-preemptive priority scheduling algorithm When the process has an event that abandons the processor, The system re-assigns the processor to another process with the highest priority.

The second type: preemptive-Priority scheduling algorithm . The processor is assigned to the highest-priority process in the ready queue for execution. But between its execution, whenever a higher priority process occurs, the scheduling algorithm assigns the processor to the new highest-priority process.

(2) Priority type

The key to the priority scheduling algorithm is how to prioritize processes and determine whether to use static or dynamic precedence.

Static precedence : Determined at the time the process is created, remains intact during the entire run of the process.

Dynamic priority : At the beginning of the creation process, a priority is given to it, and then changes in its value as the progress of the process or the wait time increases, in order to achieve better scheduling performance.

3. Multi-Queue scheduling algorithm

The various scheduling algorithms mentioned above, especially in the process scheduling, because the system only set up a process of the ready queue, that is, the low-level scheduling algorithm is fixed, single, can not meet the different users of the system process scheduling policy requirements, in the multiprocessor system, this single scheduling policy implementation of the shortcomings of the mechanism is more prominent, Thus, the multilevel queue scheduling algorithm can compensate for this point to some extent.

The algorithm divides the process-readiness queue in the system from one to several, assigns different types or natures of processes to different ready queues, different ready queues take different scheduling algorithms, and the processes in a ready queue can set different priorities. The different ready queues themselves can also have different priority settings.

The multi-queue scheduling algorithm can implement different scheduling algorithms for each ready queue because of the setup of multiple ready queues, so it is easy to provide multiple scheduling strategies for the needs of different user processes.

"The various process scheduling algorithms described earlier have some limitations. If the process length is not indicated, both the short process first and the process-length-based preemptive scheduling algorithm will not be available. The multi-level feedback queue scheduling algorithm, as described below, does not have to know the execution time required by various processes in advance, but it can also satisfy the needs of various types of processes, so it is a well-known process scheduling algorithm.

4. Multilevel feedback queue scheduling algorithm

Multi-level feedback queue scheduling algorithm Scheduling mechanism can be described as follows:

     (1) sets multiple ready queues. set multiple ready queues in the system, and give each queue a different priority. The first queue has the highest priority, followed by the second, and the remaining queues are prioritized one by one. The algorithm is different from the time slices given by the processes in different queues, and the smaller the time slices in the higher priority queue.

   (2) Each queue uses the FCFS algorithm

   (3) scheduling by queue priority. The scheduler first dispatches the processes running in the highest-priority queue 。 The process in the second queue is scheduled to run only when the first queue is idle; in other words, only 1 i-1 when all queues are empty, the run in queue I will be dispatched. If the processor is servicing a process in queue I, and there is a new process entering either of the higher priority queues, the running process is immediately put back at the end of queue I, and the processor is assigned to the new high-priority process.

Scheduling algorithm Performance

If the time slice of the first queue is slightly larger than the processing time required by the majority machine interaction, it is better to meet the needs of various types of users.

(1) Terminal type User

(2) Users of short batch processing jobs

(3) Long batch processing job users

Scheduling algorithm based on fairness principle

5. Guaranteed Scheduling Algorithm : The processor time that is not assigned to "each process".

6, fair sharing scheduling algorithm: The same processor time is not assigned to "per user".


This article is from the "City Hunter" blog, please be sure to keep this source http://alick.blog.51cto.com/10786574/1786262

Common process scheduling algorithm---operating system

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.