Operating system learning notes (6) Process Scheduling Algorithm

Source: Internet
Author: User

Scheduling objectives:

1. Fairness
2. Processor utilization
3. Increase system throughput
4. Minimize Process Response Time

Scheduling principles:
Response time, turnaround time, and end time
System throughput, processor utilization, resource balance, fairness, priority

Process Scheduling Method:
Non-deprivation mode: end and I/O application. This method is not conducive to real-time systems and time-sharing systems with high "timeliness", and is mainly used for batch processing systems.
Deprivation mode: time slice completion, low priority. It is used in Real-Time, time-based, and highly demanding batch processing systems.

Scheduling type:
1. Batch scheduling, time-based scheduling, real-time scheduling, and multi-Processor Scheduling
2. Long-range scheduling, mid-range scheduling, short-range Scheduling
3. I/O Scheduling

Long-range scheduling:
Job Scheduling (from memory scheduling to memory). After a process is created, it may wait for short-range scheduling and mid-range scheduling.
Two problems:
1. Select the number of jobs to enter the memory (depending on the degree of Multi-Program)
2. Which jobs are selected (depending on the long-range Scheduling Algorithm)

Short-range scheduling: Process Scheduling

Mid-process scheduling: Scheduling of pending processes
The objective is to improve memory utilization and system throughput.

Process Scheduling Algorithm:
-(First served FCFS)
FCFS is non-deprivation type
-Unfair process disconnection
-I/O-type process unfair
-Use FCFS in combination with other algorithms.
-FCFS is suitable for long, medium, and short processes.

Short Process Priority:
Non-deprivation Scheduling Algorithm
Problem:
1. Process execution time is hard to predict
2. It may cause hunger and thirst.
3. Non-deprivation scheduling is adopted without considering the degree of urgency of the process. It is not suitable for time-sharing systems and transaction processing systems.

Time slice rotation scheduling algorithm:

Time slice settings:
Process switching increases system overhead
Considering the maximum number of users, response time, and system efficiency of the system

The average turnaround time of this algorithm is relatively long.
It is often used in time-sharing systems and transaction processing systems. A reasonable time slice will bring a satisfactory response time.
A reasonable time slice allows processes around % 80 to be completed in one time slice.
It is advantageous for short and computation processes and is not suitable for batch processing systems.
It is not conducive to io-type processes. (I/O type can be placed in a queue with higher priority)

Priority-based scheduling algorithm:
1. The time slice rotation scheduling algorithm is fair to every process.
2. In actual application, the nature of the process may be different.

Set priority:
Importance of process functions
Urgency of process functions
For balanced resources, specify priority
Usage of resources by processes

Static and Dynamic Priority:
Principles:
Process remaining time high priority
Process Response priority
Implementation: Calculate the priority when the clock is interrupted
Disadvantage: it is difficult to estimate the remaining execution time and increase system overhead, which is unfair to long processes.
Response Ratio: r = (W + S)/S = W/S + 1 (w-wait time s-expected execution time)

Feedback scheduling algorithm:
Adjust Scheduling Based on the process execution history.
It facilitates interactive process disconnection or short batch processing.
Long process turnaround time increases sharply

Real-Time System:
Respond to external events in a timely manner and complete the tasks within the specified time.

Real-time Control System:

Real-time information processing 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.