This is an Operating System question. Can anyone help me with this scheduling si
ID: 646396 • Letter: T
Question
This is an Operating System question. Can anyone help me with this scheduling simulation problem?
Please clearly label your final answers and show all significant steps in your computation. Thanks!
The professor decides, ultimately, to pace himself based on how many students are waiting for their scores to be returned to them. If he is willing to keep 5 students, on average, waiting for their scores, how quickly must he grade the exams? Assume that exams continue to arrive at the same rate of 3 per hour.Explanation / Answer
Round robin scheduling algorithm with Example
Round robin is the scheduling algorithm used by the CPU during execution of the process . Round robin is designed specifically for time sharing systems . It is similar to first come first serve scheduling algorithm but the preemption is the added functionality to switch between the processes .
A small unit of time also known as time slice or quantum is set/defined . The ready queue works like circular queue .All processes in this algorithm are kept in the circular queue also known as ready queue . Each New process is added to the tail of the ready/circular queue .
By using this algorithm , CPU makes sure, time slices ( any natural number ) are assigned to each process in equal portions and in circular order , dealing with all process without any priority .
It is also known as cyclic executive .
The main advantage of round robin algorithm over first come first serve algorithm is that it is starvation free .Every process will be executed by CPU for fixed interval of time (which is set as time slice ) . So in this way no process left waiting for its turn to be executed by the CPU .
Round robin algorithm is simple and easy to implement . The name round robin comes from the principle known as round robin in which every person takes equal share of something in turn .
Pseudo Code :
* CPU scheduler picks the process from the circular/ready queue , set a timer to interrupt it after 1 time slice / quantum and dispatches it .
* If process has burst time less than 1 time slice/quantum
> Process will leave the CPU after the completion
> CPU will proceed with the next process in the ready queue / circular queue .
else If process has burst time longer than 1 time slice/quantum
> Timer will be stopped . It cause interruption to the OS .
> Executed process is then placed at the tail of the circular / ready querue by applying the context switch
> CPU scheduler then proceeds by selecting the next process in the ready queue .
Here , User can calculate the average turnaround time and average waiting time along with the starting and finishing time of each process
Turnaround time : Its the total time taken by the process between starting and the completion
Waiting time : Its the time for which process is ready to run but not executed by CPU scheduler
for example ,
we have three processes
Burst time Waiting time Turnaround time
P1 24 6 30
P2 3 4 7
P3 3 7 10
So here we can see the turnaround time for the process 1 is 30 while 7 and 10 for 2nd and 3rd process
A Gantt chart is a chart which shows the start and finish times of all the processes .
Gantt chart for the round robin algorithm is
|-----------|-----------|----------|------------|------------|------------|------------|---------------|
| P1 | P2 | P3 | P1 | P1 | P1 | P1 | P1 |
|-----------|-----------|----------|------------|------------|------------|------------|---------------|
0 4 7 10 14 18 22 26 30
The major features of the Round Robin algorithm is that
* Throughput is low as the large process is holding up the Central processing unit for execution .
* The main advantage of Round robin is to remove starvation . As long as all processes completes the execution then we dont have any trouble, But the problem starts when any of the process fails to complete . The incomplete execution of any process leads to starvation .
* Queuing is done without using any prioritization of the processes.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.