Question

In: Computer Science

An operating system uses the Round Robin (RR) without priority CPU scheduling algorithm, with a quantum...

An operating system uses the Round Robin (RR) without priority CPU scheduling algorithm, with a quantum = 4.

Consider the following set of processes in this OS, with the length of the CPU burst time given in milliseconds, and the shown priority.

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.

Process Burst Time Priority
P1 5 2
P2 10 5
P3 4 1
P4 6 4
P5 9 3

a) Draw a Gantt chart illustrating the order of execution of these processes, showing their completion times.

b) Calculate each process’ waiting time, and then compute the average waiting time for this set.

Note:  waiting time = completion time – arrival time – burst time

=> Write your answers on scratch paper (make sure it is visible) then take a picture of it and upload it here.

Solutions

Expert Solution

The below information is given in the problem:

Process

Burst Time

P1

5

P2

10

P3

4

P4

6

P5

9

Round robin is a CPU scheduling algorithm in which the processes are allocated a fixed time slice know as quantum in a circular way.

The priority of the process should be ignored as it is given in the problem that we have to compute values for RR without priority

Using Round Robin scheduling these processes will be scheduled as per below Gantt Chart:

The completion time of a process is calculated as the time at which process completes its execution

The turnaround time is the time difference between completion time and arrival time
Turnaround time = Completion time - Arrival time


The Waiting time is the time difference between turnaround time and burst time.
Waiting Time = Turnaround time - Burst Time

So using the Gantt chart and formula above we can compute the Turnaround time and waiting
time as follows :

Quantum = 4

Process

Burst Time

Waiting Time

Turnaround Time

P1

5

16

21

P2

10

23

33

P3

4

8

12

P4

6

21

27

P5

9

25

34

                        

B) Average Waiting Time

Process

Waiting Time=Completion Time – Arrival Time – Burst time

P1

21 – 0 –     5   = 16

P2

33 – 0 – 10    = 23

P3

12 – 0 –    4    =   8

P4

27 – 0 –   6    = 21

P5

34 – 0 –   9    = 25

Average waiting time = Sum of waiting time for each process / Number of processes

Average Waiting Time = (16 + 23 + 8 + 21 + 25) / 5 = 18.6 ms


Related Solutions

An operating system uses the Round Robin (RR) without priority CPU scheduling algorithm, with a quantum...
An operating system uses the Round Robin (RR) without priority CPU scheduling algorithm, with a quantum = 4. Consider the following set of processes in this OS, with the length of the CPU burst time given in milliseconds, and the shown priority. The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. Process Burst Time Priority P1 5 2 P2 10 5 P3 4 1 P4 6 4 P5 9 3...
First-Come, First-Served (FCFS) Scheduling Shortest-Job-Next (SJN) Scheduling Priority Scheduling Shortest Remaining Time Round Robin(RR) Scheduling Multiple-Level...
First-Come, First-Served (FCFS) Scheduling Shortest-Job-Next (SJN) Scheduling Priority Scheduling Shortest Remaining Time Round Robin(RR) Scheduling Multiple-Level Queues Scheduling Provide a timing example of each of the algorithms above. List some processes (at least four) with the appropriate properties for creating a time diagram (such as Process ID, Arrival Time, Burst Time, and Execution Time). Walk through the timing diagram identifying the algorithm you’re using and state which process goes first, which process finishes first, etc.
The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is...
The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is assigned a numerical priority,with a higher number indicating a higher relative priority. The scheduler will execute the highest-priority process. For processes with the same priority, a round-robin scheduler will be used with a time quantum of 10 units. If a process is preempted by a higher-priority process, the preempted process is placed at the end of the queue. Process            Burst Time Arrival Time...
Question 5 The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each...
Question 5 The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is assigned a numerical priority,with a higher number indicating a higher relative priority. The scheduler will execute the highest-priority process. For processes with the same priority, a round-robin scheduler will be used with a time quantum of 10 units. If a process is preempted by a higher-priority process, the preempted process is placed at the end of the queue. Process          Burst Time      Arrival Time   Priority P1                15            0            8...
An operating system uses the First-Come, First-Served (FCFS) CPU scheduling algorithm. Consider the following set of...
An operating system uses the First-Come, First-Served (FCFS) CPU scheduling algorithm. Consider the following set of processes in this OS, with the length of the CPU burst time given in milliseconds, and the shown priority. A larger priority number implies a higher priority. There is no pre-emption. The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. Process Burst Time Priority P1 2 2 P2 1 5 P3 4 1 P4...
For Round Robin (RR) Scheduling, What is the arrival time, completion time, burst time, turnaround time,...
For Round Robin (RR) Scheduling, What is the arrival time, completion time, burst time, turnaround time, and the waiting time? discuss these terms further as they pertain to the efficiency of the algorithm as well as properties such as starvation. Pros and Cons of RR
Java round robin scheduling algorithm: 10 processes arrive at the same time and the time that...
Java round robin scheduling algorithm: 10 processes arrive at the same time and the time that each requires is random. Show that the output of the original list and list as it changes all the way until nothing is left in the array. Using only main method and not any additional static methods and Only using scanner, arrays, and for looper while/do while loops. No array lists or other methods in java.
Solve the the process scheduling problem using the round robin FCFS algorithm studied in assignment 7....
Solve the the process scheduling problem using the round robin FCFS algorithm studied in assignment 7. The program will show the order of execution of the processing and will provide the average waiting time for the following scenarios: a) Time quantum =1 b) Time Quantum=3 Use the table below to draw the Gantt Chart (Spread sheet or by hand). Process ID Arrival Time Burst Time 1 0 4 2 1 5 3 2 2 4 3 1 5 4 6...
Describe how the Round Robin Scheduling algorithm works. Explain the differences of working procedure between preemptive...
Describe how the Round Robin Scheduling algorithm works. Explain the differences of working procedure between preemptive and non-preemptive version of this algorithm.
Explain RR scheduling uses preemption and priorities. (b) Does RR scheduling use multiple classes of processes?...
Explain RR scheduling uses preemption and priorities. (b) Does RR scheduling use multiple classes of processes? Why? Explain.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT