2019329621249陈雅冰homework3 Version 0 |
|
👤 Author: by 1422679707qqcom 2021-12-22 02:39:42 |
Cpu scheduling standard:
1. First-come, first-served service (FCFS): the process that requests first gets the CPU first. Non-preemptive scheduling algorithm, if the first process takes more time (expressed by CPU interval), the efficiency will be very low, and the next process will wait for a long time.
2. The shortest job priority scheduling SJF: When the CPU is idle, it will be assigned to the process with the shortest CPU interval. If two processes have the same COU interval segment, they are allocated according to FCFS. However, CPU interval is not easy to obtain, so it is often used for long-term scheduling, because users can specify CPU interval for long-term scheduling process. It can be preempted or non-preempted. If it is preempted, if it is found that there is a process smaller than the CPU interval of the currently running process, the CPU will be preempted. Preemption SJF is also called the shortest remaining time priority scheduling.
3. Priority scheduling: each process has a priority, and the process with the highest priority will allocate CPU. The CPU with the same priority is allocated by FCFS. There can also be a distinction between preemption and non-preemption. If it is non-preemption, the one with high priority will be first placed in the ready queue. There is a major problem: hunger (infinite blocking), that is, processes can run but are not allocated to CPU, and low-priority processes will be hungry, and the solution is aging: that is, with the increase of waiting time, the priority of low-priority processes will increase, so that they can be executed.
4. Round robin scheduling (RR): It is similar to FCFS, but it is a preemptive scheduling, which divides the CPU into a small time slice. When the time slice arrives, the CPU selects the first process from the ready queue for allocation and puts the executed process at the end of the ready queue.
5. Multi-level queue scheduling: When processes can be divided into different groups, the ready queue can be divided into several independent queues, for example, according to process attributes, process types and so on. A process is permanently assigned to a queue, and each queue has its own scheduling algorithm. The above four kinds of scheduling algorithms are used. But this method is not flexible enough.
6. Multi-level feedback queue scheduling: allow processes to move between queues. If the process uses too much CPU time, it will be transferred to a lower priority queue. In this way, the process with long waiting time in the lower priority queue will be transferred to the higher priority queue, and this form of aging can avoid starvation.
CPU burst time lt s the amount of time required by a process or can be said the amount of time required by the process to frish We cannot estimatethe time taken by the process before running it. Thus, most of the problem is related to the burst time.
Burst Time=Turn around Time(Completion Time)-Waiting Time.This is the time that a process spends on the CPU execoting some code.CPU Burst deadswith the running state of the process.
I/o burst time:While the process is in the running state, it may ask for I/O, thus the process goes to the blOck or wait state, where the I/O will beprocessed and then it will be sent back to the ready state. This is the time that a process spends in wating for the completion of the I/O request I/O Burst deals with the waiting state of the process.