
Waiting time is the sum of the periods spent waiting to be executed by the CPU. The interval from the time of submission of a process to the time of completion is the turnaround time. By using these derived values from the chart, we can find the following Scheduling Criteria. These terms are the key points of a process scheduling algorithm. P4 arrives at 8ms, starts to execute at 15ms, waiting time = 7ms.P3 arrives at 6ms, starts to execute at 10ms, waiting time = 4ms.P2 arrives at 2ms, starts to execute at 4ms, waiting time = 2ms.P1 arrives at 0ms, starts to execute at 0ms, waiting time = 0ms.This scenario is somewhat complex to imagine, because of that we use Gantt charts for drawing this.Īs you see here, now you can easily define following terms,

Each of these processors will wait until the termination of the currently executing process. Then the process numbers P2, P3 and P4 will take the chances to be executed by the CPU according to their arrival time. Process numberĪccording to the FCFS algorithm, the CPU will take the P1 process at first as it is the firstly arrived process in the queue. Suppose, we have 4 processors called P1,P2,P3,P4, which are arrived to the queue at 0ms,2ms,6ms and 8ms, and the corresponding burst times( the time that each of the processors uses to execute its instructions ) are 4ms, 6ms, 5ms, 3ms. Once a process terminates its execution, the next process which is secondly arrived at the queue will start to execute and it keeps remain until it terminates ( Assume that no interruptions happen). So, all the processors share the priority in ascending order according to their arrival time. The easiest one among these Process Scheduling algorithms is the FCFS algorithm, it only gives the highest priority for the firstly arrived process.

There are 3 main Process Scheduling Algorithms. these mechanisms are collectively known as Process Scheduling algorithms. In order to do that, we use a logical mechanism for selecting and executing a particular process at a given time.

As we know a single-core CPU executes its processors one by one at a particular time, but when there are lots of processors in the ready queue, the CPU needs some mechanism to choose one of those processors.
