fcfs调度算法
CPU scheduling decides which of the available processes in the ready queue is to be allocated the CPU. There are different CPU scheduling algorithms available. In this tutorial, we will learn about the First Come First Served Algorithm (FCFS) and see how we can implement it in C Programming Language?
CPU调度决定要为就绪队列中的哪些可用进程分配CPU。 有不同的CPU调度算法可用。 在本教程中,我们将学习先来先服务算法(FCFS),并了解如何用C编程语言实现它 ?
先来先服务(FCFS) (First Come First Serve (FCFS))
First Come First Serve is the simplest and easiest scheduling algorithm. In this algorithm, the CPU is allocated to the processes in the order they request it. The implementation of FCFS is easily done with a queue (a FIFO structure). When the first process enters the system it starts its execution immediately and runs till it completes its execution. As other processes enter the system, they are put at the end of the queue and wait to get the CPU. When a process finishes executing, it releases the CPU, is removed from the queue and the CPU is allocated to next process at the head of the queue.
先来先服务是最简单,最简单的调度算法。 在此算法中,CPU按照请求的顺序分配给进程。