![]() ![]() And since p1 is processed for 2 time quantums, its burst time will be reduced to 3. Ready queue is used to see the processes which have arrived, and processing is done in the "running queue".Īfter 2 units of time, process p2 and p3 will be ready for processing, so we can add them to ready queue. For example, process p1 has arrival time 0, So currently our ready queue will have process p0.Īfter 2 units of time, process p2 will arrive and then it will be added to the ready queue When Arrival time of CPU matches the CPU time, the process is ready to be processed and hence, added to the ready queue. Now we have something called the "Ready queue" and "Running queue" in which processes are added. The processes are entertained on the basis of their arrival time, i.e, the process which has less arrival time means that the process came early and should be processed first as per first come first serve rule. Multiple processes come to the CPU for scheduling, these processes have their arrival time and burst time. Well we can have multiple processors, but it would be waste of money and most of the time our processors would be in idle condition. You might wonder that why don't we have multiple processors. This context switching is so fast that it seems that all the processes are running in parallel. CPU's scheduling algorithm runs one process for some time, halts it, and runs other process for some time. It might seem to us that all the processes are executing in parallel, but they are not. Our CPU uses context-switching to overcome the problem of lack of processing cores / processors. But our computer don't have many cores, to take multiple requests. We do multi tasking on our machines, we download a movie from the internet, play music, and do programming, all at the same time. ![]() Why do we need scheduling algorithm anyway ? And time quantum is the time limit which is set by the cpu, one process can run for at max t units of time or time quantum. Burst time of a process is the time required for it to complete. Arrival time of a process, as the name signifies, is the time at which the process came for scheduling. ![]() A CPU scheduling algorithm is nothing but an algorithm which schedules the processes based on their arrival time, burst time and CPU's time quantum. Round Robin is a very popular CPU scheduling algorithm. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |