Common operating system algorithms

Source: Internet
Author: User
I. Process (job) scheduling algorithm l first comes the service scheduling algorithm (FCFS): Each scheduling is from the ready queue, select a process that first enters the ready queue, assign the processor to the process for execution. Once a process occupies a processor, it continues to run until the process is completed or blocked due to an event. Features: It facilitates long processes and is not conducive to short processes. L short process (job) Priority Scheduling Algorithm (SPF): it selects a process from the ready queue to estimate the minimum running time and assigns the processor to the process, it occupies the processor and runs until the process is completed or blocked due to an event, and then exits the processor and re-schedules it. L time slice rotation scheduling algorithm: The system sorts all ready processes in the order of entering the ready queue. During each scheduling, the CPU is allocated to the first process of the team to execute a time slice. When the time slice is used up, the timer will interrupt the clock, and the scheduler will suspend the execution of the process, exit the processor and send it to the end of the ready queue, waiting for the next round of scheduling. L priority number scheduling algorithm: This algorithm selects a process with the highest priority from the ready queue to obtain and execute the processor. L response-to-high priority scheduling algorithm: it selects a process with the highest response ratio from the ready queue and allows it to get processor execution, it is not until the process is completed or the processor exits due to waiting for the event. Features: it not only takes care of short processes, but also considers the order of arrival of processes, and does not make long processes unavailable for a long time. Therefore, it is a comprehensive algorithm, however, each time you schedule a task, you need to calculate the Response Ratio of each process. Therefore, the system overhead is very large and complicated. L basic concepts of multi-level queue scheduling algorithm: Job turnaround time (Ti) = completion time (TEI)-submission time (TSI) average job turnaround time (t) = turnaround time/number of jobs weighted turnaround time (WI) = turnaround time/running time response ratio = (Waiting Time + running time) /run time II. Partition allocation algorithm N in the memory continuous allocation mode adaptive allocation algorithm (FF) for the first time: the requirements for idle Partition Table records are arranged in an ascending order of addresses, during each allocation, the system always searches for the idle Partition Table from 1st records, finds the first idle partition meeting the job length requirements, splits the idle partition, and assigns a part to the job, the other part is still in the idle zone. N-cycle adaptive algorithm for the first time: each allocation starts from the last allocation position. N optimal adaptive allocation algorithm (BF): selects a minimum idle zone that can meet the job requirements from all idle partitions according to job requirements. This ensures that a larger area is not separated, this makes it easier to load large jobs. To implement this algorithm, the idle area is registered in the idle area table in ascending order of length. When allocated, it is searched in sequence. 3. Page Replacement Algorithm l Optimal Replacement Algorithm (OPT): select a memory page that will never be used or will not be accessed for the longest time to be eliminated. L first-in-first-out replacement algorithm (FIFO): select the first page to go to the memory for elimination. L least recently used algorithm (LRU): select a page that has not been used for the longest time in the recent period and eliminate it. L least use algorithm (LFU): select the page conversion with the least number of visits to the current time. 4. disk scheduling n first-come-first-served (FCFS): the disk drive is started in the order of visitor requests, regardless of the physical locations to access N (sstf ): to enable a visitor who is closest to the current track to start the disk drive is to run the job with the shortest time without considering the order of visitors, in this way, we can overcome the problem of too much movement of the magnetic arm in the first service scheduling algorithm. The N scan algorithm or the elevator scheduling algorithm always starts from the current position of the magnetic arm, select the visitor of the cylinder closest to the current yarn along the direction of the yarn. If no access is requested along the direction of the magnetic arm, the movement direction of the magnetic arm is changed. In this scheduling method, the movement of the magnetic arm is similar to that of the elevator, so it is also called the elevator scheduling algorithm. N-cycle scanning algorithm (cscan): the cyclic scanning scheduling algorithm is improved based on the scanning algorithm. The magnetic arm is changed to a single movement, from the external to the internal. The current position begins to move along the direction of the magnetic arm to select the visitor of the column closest to the current magnetic arm. If there is no request for access in the direction of the magnetic arm, and then return to the outermost, the request for accessing the job with the smallest cylinder number.

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.