 work as an assistant professor in computer science and engineering department at Valchiyan Institute of Technology, Solapur. Today we are going to discuss about the scheduling criteria and different scheduling algorithms. At the end of this lecture students will understand the different scheduling criteria and also get the basics of scheduling algorithms. Now let's see the basics of scheduling algorithm. Now when multiple processes are came for the execution purpose in main memory, at that time we need to schedule this process to get the proper utilization of CPU. Means the different CPU scheduling algorithms have the different properties and the choice of a particular algorithm may favor one class of process over the other. So this scheduling or this selection of the process for the execution have many criteria. The first one is CPU utilization throughput, turn around time, waiting time and response time. So now let's see the CPU utilization. So now CPU utilization means what? CPU utilization means keeping the CPU busy as much as possible. How to keep the CPU busy? That is the basic question. So now when processes are going to execute, at that time process needs the CPU and also then needs the input output devices also. So now while switching for the IO device, at that time CPU is idle. So at that time we can execute the another process. So in that way we can utilize our CPU. So conceptually the CPU utilization can range from 0 to 100%. In the real system it should be range from the 40% to 90%. So now throughput, now throughput means what? Now throughput is nothing but the number of processes that are completed per time unit. That's called this throughput. That's when the n number of processes are in a ridicule for the execution purpose. So at that time, in a given time period the number of processes are executed. That is nothing but the throughput. For a long process this rate may be one process per hour. For a short transaction it may be the 10 processes per second, turn around time. So now turn around time is nothing but the interval from the time of submission of a process to the time of completion. That is nothing but the turn around. The turn around time is the sum of the periods, spending, waiting time to get into the memory. The waiting in the ridicule, executing on the CPU and doing the input output. So that is nothing but the turn around time. Now waiting time. So now waiting time means what? Now when the different processes came for the execution purpose in your main memory, at that time all these processes are in the ridicule for the execution. But due to some interrupts or due to some higher process priorities, these processes are in the waiting. So now it affects the only the amount of time that a process spends the waiting in the ridicule. The waiting time is nothing but the sum of periods spends waiting in the ridicule. Now response time. So response time is the time it will start responding, not the time it takes to the output to the response. Means what? That is nothing but the time from the submission of a request until the response is produced. Means when one process is submitted for the execution purpose. And now CPU is executing that process and where get and CPU is giving the response. So that is nothing but the response time. The turn around time is generally limited by the speed of the output device. But here it is the, it takes the time to start the responding. It is desirable to maximize the CPU utilization and throughput and to minimize the turn around time, waiting time and response time. So now let's see the different scheduling algorithms. So now first one is the first come first serve scheduling, shortage of first scheduling, priority scheduling, round-robin scheduling. So let's see the first come first serve, which is scheduling. With this scheme the process that I request the CPU first is allocated the CPU first. The implementation of the FCFS policy is easily managed by the first in first out queue. It means for the implementation of this FCFS we need to use the queue concepts. When the process enters the ready queue its PCB is linked on to the tail of the queue. When the CPU is free it is allocated to the process at the head of the queue. The running process is then removed from the queue. Means what? Basically we'll see we'll have process P1, P2 and P3 here. So now here we need its burst time. So now here this burst time is nothing but the total time required for the execution of that process. Now let's see here 10, 20 and 30. So now this is nothing but the burst time. So now while execution the in FCFS manner the first P1 has come then it's going to execute the P1 and then P2 and then P3. So now this one is nothing but the Gantt chart for the. So now let's see the shortage of first scheduling. In the shortage of first scheduling the process with the minimum burst time is going to be execute the first. This algorithm is associated with each process the length of the process next CPU burst. When the CPU is available it is assigned to the process that has the smallest next CPU burst time. If the next CPU burst of the two process are the same the FCFS scheduling is used to break the time. Note that more appropriate term for the scheduling method would be the shortest next CPU burst time because scheduling depends on the length of the next CPU burst of a process rather than its total length. Means here it's going to say that when this process are going to be execute. So now while executing the minimum burst time is going to be execute first. So that is nothing but the scheduling. So now we'll see with the example here. So now let's see the priority scheduling algorithm. In this priority scheduling algorithm like the burst time will have the priority for the each process. Now here the highest priority process is going to be execute first. So now here equal priority processes are scheduled in the FCFS order that is the very important concept because if the priority of the two process are the same then there is no need to get confused. Here we are going to follow the FCFS order. The low number present the high priority basically this depends on the different systems. So now let's see now like the burst time here we'll have the priority also now let's consider we'll have the 0, 1 and 2 as the priority for the P1, P2 and P3. So now here in this example first P3 is going to execute, then P1 is going to execute and then P2. So now this is the sequence for the execution of the different process for the priority scheduling. P3 has the lowest priority. So now here in this way we are going to execute the process with this. So let's see the round robin scheduling algorithm. In this round robin scheduling algorithm here we need to give the time quantum or we can call it as a time slice. It means each process is going to be execute for the specific time period only. Let's say consider in this given example in this example we have taken the burst time as a time slice is equals to 5 milliseconds. So now here each process is going to execute approximately for the 5 seconds only. So let's see the first P1 will execute for the 0 to 5 then here we need to calculate its remaining time. So now its remaining time is 5. Then we are going to execute P2 for the next 5 seconds. So now here its remaining time is 15. So now P3, it's 15, so now its remaining time is 25. So now again we'll start from the first one, now P1 here, now it's 20. Now here P1 has been completed its task. So now we'll go for the P2. It's 25. Now its remaining time is now 10. Now then P3, 30, now it's 20. So now in this way we are going to execute each process for the specific period of. So that is nothing but the round-robin scheduling. So now each scheduling of algorithm affects on the throughput of the system. Pause the video and write your answer. Yes, CPU utilization and depends on the type of scheduling algorithm it's going to use. If the system is unable to execute many process in less time then it affects on the throughput of the system. References operating system concepts from the Galvin system programming and operating system from the DEMD array. Thank you.