Question

In: Computer Science

A set of processes along with their burst time in milliseconds is given below. The processes...

A set of processes along with their burst time in milliseconds is given below. The processes should execute in First Come First Served order. Assume that the quantum (q) is 3:

Process Burst Time

P1 22

P2 4

P3 12

P4 15

P5 2

Find the average waiting time using the Round Robin algorithm. Round your answer to 2 decimal places

Solutions

Expert Solution

A set of process is given with the burst time in milliseconds. the proceaa will execute First come First serve process and the quantum time |q| is 3 ms.

Round Robin Scheduling algorithm is used in Multitasking operating system and Time sharing basically based on First Come First Serve.

      Process

Burst Time ( ms)

            P1

         22

            P2

          4

            P3

         12

            P4

         15

            P5

          2

The quantum |q| is 3 millisecond and the arrival time is 0. Draw the Gantt Chart for the process to find out the average waiting time and turn around time.

P1 gets the CPU at the 0 ms so when P1 gets the CPU it has to execute the how long the burst time of the P1 i.e 6 22 ms but we need to allow it to excute only equals to the time quantum |q| which is 3 ms

Gantt Chart :

0       3        6        9     12      14    17 18 21    24    27    30   33 36 39   42

P1

P2

P3

P4

P5

P1

P2

P3

P4

P1

P3

P4

P1

P3

P4

42      45        48      51       54     55

P1

P4

P1

P1

P1

Method to find out the waiting time

Turnaround Time = Complition Time – Arriving Time

Wating Time = Turnaround time – Burst time

   Process

Complition Time (ms)

Turn around Time (ms)

Waiting Time (ms)

         P1

         55

55 – 0 = 55

55 – 22 = 33

       P2

         18

18 – 0 = 18

18 – 4 = 14

        P3

         39

39 – 0 = 39

39 – 12 = 27

        P4

         48

48 – 0 = 48

48 – 15 = 33

        P5

         14

14 – 0 = 14

14 – 2 = 12

Average Turnaround time is

( 55 + 18 + 39 + 48 + 14 ) / 5

34.80 ms

Average Waiting Time is

( 33 + 14 + 27 + 33 + 12 ) / 5

23.80 ms


Related Solutions

Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4            The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. If FCFS scheduling is used, what is the average turnaround time of these processes? Answer: Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4           ...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Arrival Time Burst Time P1 0 5 P2 2 3 P3 3 2 P4 4 4 P5 5 3 a. Draw Gantt charts illustrating the execution of these processes using SJF pre-emptive b. What is the turnaround time of each process for each of the scheduling algorithms c. What is the waiting time of each process for each of the scheduling algorithms  
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority Arrival Time P1 10 3 0 P2 1 1 12 P3 2 4 0 P4 1 5 0 P5 5 2 0 In the above table, a smaller priority number implies a higher priority. Suppose that these processes are scheduled by the priority policy with preemption. Draw the Gantt chart (i.e., time chart) illustrating the execution of these processes. What...
Consider the following set of processes, with the length of the CPU burst given in milliseconds:...
Consider the following set of processes, with the length of the CPU burst given in milliseconds: Process Burst Time Priority P1 2 2 P2 1 1 P3 8 4 P4 4 2 P5 5 3 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, non preemptive priority (a smaller priority number implies...
1. Consider the following set of processes, with the length of CPU burst and arrival time...
1. Consider the following set of processes, with the length of CPU burst and arrival time given in milliseconds.                                                              Process            Burst time       Priority            Arrival Time             P1                         10                    3                              0 P2                          1                     1                              2 P3                          2                     4                              4 P4                          5                     2                              8 a) Draw the Gantt chart that illustrates the execution of these processes using the preemptive priority scheduling algorithm (a smaller priority number implies a higher priority). b) What...
You are given the following processes with CPU-burst time, arrival time and priority (lower # means...
You are given the following processes with CPU-burst time, arrival time and priority (lower # means higher priority) Process CPU-burst Arrival time Priority P1 12 0 5 P2 6 6 2 P3 9 1 2 P4 14 3 1 P5 7 5 4 For each of the following scheduling algorithm, show (using the diagram as in the slides), how the process are being executed. Also calculate the average wait time. Shortest job first (non-preemptive) Shortest remaining job first (preemptive) Priority-based...
6. Consider the following set of processes P1, P2, P3, P4. Process Burst Time Arrival Time...
6. Consider the following set of processes P1, P2, P3, P4. Process Burst Time Arrival Time Priority P1 3 0 1 P2 5 1 2 P3 8 3 3 P4 4 4 2 a) Draw Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: first-come, first-served (FCFS), priority scheduling (larger number=high priority), and Round-Bobin (RR, quantum=2). b) Compute the average waiting time, turnaround time for the three algorithms. Turnaround time – amount of time to...
Consider the set of processes shown in the table above, with the length of the CPU-burst...
Consider the set of processes shown in the table above, with the length of the CPU-burst time given in milliseconds. The processes are assumed to have arrived in the order P5, P4, P3, P2 , and P1, all approximately at time 0. Draw three Gantt charts illustrating the execution of these processes using SJF, Round-Robin (quantum size = 3), and a non-preemptive priority (a smaller priority number implies a higher priority) scheduling. Calculate average waiting time of each scheduling. Calculate...
The random variable X milliseconds is the total access time (waiting time + reading time) to...
The random variable X milliseconds is the total access time (waiting time + reading time) to obtain a block of information from a computer disk. X is evenly distributed between 0 and 12 milliseconds. Before making a determined task, the computer must access 12 different information blocks from the disk. (The access times for different blocks are independent one of the other.) The total access time for all information is a random variable A milliseconds. (1) What is the E...
What is the arrival time, completion time, burst time, turnaround time, and the waiting time of...
What is the arrival time, completion time, burst time, turnaround time, and the waiting time of First Come First Serve (FCFS)?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT