Showing posts with label RR. Show all posts
Showing posts with label RR. Show all posts

C++ Program (Source Code) for Round Robin (RR) CPU Scheduling Algorithm


Round Robin (RR):

In operating systems, tasks that are queued to be processed go through different scheduling algorithms in different operating systems. Round Robing or RR is one of them.
In round robin, like first come first served, the job or task that comes first, gets processed first, but not fully. Rather in round robin, a portion or segment of the task is completed at once, then the processor moves to the next task and then processes that same amount of task for this second task in hand and it continues. When a portion or segment of all tasks has been processed, the processor starts from the beginning of the task list again and continues to process a portion or segment of each remaining tasks. However in this way, as new task can be continuously added at the end of the task list, the processor might not come back to the head of the list sooner which might cause tasks to be waiting for much longer time ultimately resulting in halted situation.


Explain and Solve : Round Robin (RR) CPU Scheduling Algorithm in C++ with Explanation


If you haven't read/tried the earlier/other problems then click the links follow:

Round Robin CPU Scheduling Algorithm in C++ with Explanation: 

This method is quite same as the FCFS but the difference is the in this case the processor will not process the whole job (process) at a time. Instead, it will complete an amount of job (quantum) at a turn and then will go to the next process and so on. When all job has got a turn, it will again start from the first job and work for a quantum of time/cycle on each job and proceed. Now consider a CPU and also consider a list in which the processes are listed as follows,

Arrival
Process
Burst Time
0
1
3
1
2
2
2
3
1

Quantum = 2 Second