Summary of Scheduling Algorithms in "Introduction to Operating Systems"

First, the scheduling algorithm:

(FCFS) First Come First Served Scheduling Algorithm

        Select the first process to reach the ready queue from the head of the ready queue;

        It is suitable for long-term processes, and there will be no problems that the turnaround time caused by short processes is too long, and the average turnaround time of the system is also relatively long.

(SPF) Short Process First Scheduling Algorithm

        Select the process with the shortest estimated running time from the ready queue and assign the processor to it;

        It can effectively reduce the average waiting practice of the process and improve the throughput of the system

priority scheduling algorithm

        Non-preemptive: During the running of the process, even if a high-priority process arrives, the system cannot deprive the current process of the CPU usage rights

        Preemptive: If the priority of the newly arrived process is higher than the priority of the currently running process, the system will preempt the CPU and assign it to the newly arrived high-priority process

        Static: The priority remains the same throughout the runtime of the process

        Dynamic: priorities change as the process progresses or as its waiting practice increases

(RR) Time Slice Round Robin Scheduling Algorithm

        Assign a time slice to each process, when the time slice runs out, the scheduler terminates the execution of the current process and sends it to the end of the ready queue

Multi-level queue scheduling

        The ready queue is divided into multiple independent queues. According to some properties of the process (such as the size of the memory to be occupied, the priority of the process, or the type of the process), the process will be permanently assigned to a queue. Each queue has its own scheduling algorithm. Different queues have different priorities, and the scheduling algorithms may also be different.

Multilevel Feedback Queue Scheduling

        In a system using multi-level feedback queue scheduling, multiple ready queues with different priorities are established, and time slices of different sizes are assigned to each queue. When a new process is created, it is inserted into the queue with the highest priority first. The next priority queue is scheduled only when the high priority queue is empty. In the same queue, the time slice round robin scheduling algorithm is used. Processes that use the CPU for too long will be moved to a lower-priority queue, and processes that wait too long in a lower-priority queue will be moved to a higher-priority queue. (using burn-in technique)

2. Real-time scheduling algorithm

(EDF) Earliest Deadline First Algorithm

        Processes are prioritized based on their start deadlines. The earlier the deadline, the higher the priority of the process and the earlier it gets the processor.

(LLF) Least Relaxation First Algorithm

        L=T-TC-TS

        T: the deadline for the completion of the process

        T C : current time

        T s : the time it takes to complete the task

Three, dynamic partition allocation algorithm

(FF) First Fit Algorithm

        Free partition chains are connected in increasing address order, the algorithm always allocates the memory space of the lower address part first

(NF) Cyclic First Fit Algorithm

        When allocating memory space for a process, the search starts from the next free partition of the last found free partition

(BF) Best Fit Algorithm

        All free blocks are formed in the order of increasing partition size to form a free block chain. In this way, the free area found for the first time that meets the requirements must be the size closest to the memory space required by the process.

Fourth, the page allocation algorithm

even distribution algorithm

        If there are n processes in the system and m memory page frames available for allocation, INT[m/n] page frames are allocated to each process, and the remaining MOD[m/n] page frames can be put into free pages box buffer pool.

Proportional Allocation Algorithm

        The number of page frames allocated for the process = the number of process pages / the sum of the number of all process pages x the number of page frames

Five, page replacement algorithm

best permutation algorithm

        Pages that will never be accessed in the future or pages that will not be accessed for the longest time in the future are selected as swap-out pages.

(FIFO) first in first out permutation algorithm

        When choosing to swap out pages, select the page with the earliest entry time into memory

(LRU) Longest unused permutation algorithm

        Select the most recently unused page to swap out

(LFU) Least Use Permutation Algorithm

        The page that has been used the least recently is selected as the retirement page.

6. Device Allocation Algorithm

First come first serve

Priority-based Allocation Algorithm

Seven, disk scheduling

(FCFS) First Come First Served

        Scheduling according to the order in which the process requests to access the disk

(SSTF) shortest seek time first

        The track that it requires to be accessed is the closest to the track where the current head is located, so as to minimize the seek time each time

(SCAN) Scanning Algorithm

        Also known as elevator scheduling algorithm. The algorithm not only considers the distance between the track to be accessed and the current track, but also gives priority to the current moving direction of the magnetic head.

(CSCAN) Cyclic Scanning Algorithm

        The magnetic head moves in one direction. When the magnetic head moves to the outermost track to be accessed, it immediately switches to the innermost track to be accessed, that is, the smallest track number is followed by the largest track number to form a cycle for cyclic scanning.

NStepSCAN algorithm

        The disk request queue is divided into several sub-queues of length N, and the disk scheduling will process these sub-queues in turn according to the FCFS algorithm. Each time a sub-queue is processed, the SCAN algorithm is used.

FSCAN algorithm

        The NStepSCAN algorithm is simplified, and only the disk request queue is divided into two subqueues. One is the queue formed by all the processes currently requesting disk I/O, and is processed by the disk scheduling according to the SCAN algorithm. During the scan, new requests are placed in another queue of requests waiting to be processed.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325910723&siteId=291194637