Question

In: Computer Science

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 execute a process (the time from submission to completion). Waiting time – amount of time a process has been waiting in the ready queue.

*Please answer in text format, not hand written*

Solutions

Expert Solution

Hi, hope you are doing good. If you have any query please let me know in the comment. Have a nice day!

b)

TAT=CT-AT and WT=TAT-BT

FCFS

Process    AT BT CT TAT WT
   P1    0 3 3 3 0
   P2    1 5 8 7    2
   P3    3 8 16 13 5
   P4     4 4    20 16 12

   Average TAT= (3+7+13+16)/4=39/4=9.75

   Average WT=    (0+2+5+12)/4= 19/4=4.75

Priority Scheduling

Process    AT BT CT TAT WT
   P1    0 3 3 3 0
   P2    1 5 16 15 10
   P3    3 8 11    8 0
   P4     4 4    20 16 12

   Average TAT=   (3+15+8+16)/4=10.5

   Average WT=   (0+10+0+12)/4=5.5

Round Robin Scheduling

Average TAT= (5+15+17+11)/4=48/4=12

Average WT= (2+10+9+7)/4=28/4=7

Process    AT BT CT TAT WT
   P1    0 3 5 5 2
   P2    1 5 16 15    10
   P3    3 8 20 17 9
   P4     4 4 15 11

    7


Related Solutions

Consider following four processes arriving in the order of P1, P2, P3 and P4. Process   Arrival...
Consider following four processes arriving in the order of P1, P2, P3 and P4. Process   Arrival Time CPU burst Time P1             0.0     6 P2    0.0                              8 P3              0.0                                7 P4              0.0                                 3 What is the average waiting time for RR scheduling (time quantum = 5)? What is the average waiting time for SJF scheduling? What is the average waiting time for FCFS scheduling?
Process Burst Time P1 6ms P2 2ms P3 7ms P4 3ms P5 8ms P6 10ms Using...
Process Burst Time P1 6ms P2 2ms P3 7ms P4 3ms P5 8ms P6 10ms Using the table above calculate the average wait time using First Come First Served (FCFS) and Shortest Job First (SJF) CPU scheduling.
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...
1.) You are given 4 processes P1,P2, P3, P4 all ariving at the same time t=0,...
1.) You are given 4 processes P1,P2, P3, P4 all ariving at the same time t=0, in a dual-processor SMP. (The two CPUs are referred to as CPU-0 and CPU-1.) The service time for each process is 40s, 20s, 20s and 10s respectively (a) What are the possibilities for the turnaround time of the job that includes the execution of all 4 processes? You may assume that each service time is just CPU time and no process interferes with the...
6.1) Consider 3 processes, P1, P2, and P3, all available at time 2, 0, 3, respectively,...
6.1) Consider 3 processes, P1, P2, and P3, all available at time 2, 0, 3, respectively, with the CPU bursts as 6, 9, and 4, respectively, what would be the turnaround time for each of the processes and what would be the average turnaround time for those 3 processes if SJF (Shortest Job First) CPU scheduling algorithm were used? (5 points) 6.2) Based on the same scenario given in the previous question, what would be the turnaround time for each...
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...
A company produces and sells 4 types of products – P1, P2, P3, and P4. The...
A company produces and sells 4 types of products – P1, P2, P3, and P4. The table below summarizes the relevant data. Three types of raw materials – RM1, RM2, and RM3 are required for the manufacturing process. The availability and cost per unit for each raw material are specified under the columns Available and Cost per unit, respectively. The company is contractually obligated to produce at least a minimum quantity for each product; these are specified in the row...
Let pi = P(X = i) and suppose that p1 + p2 + p3 + p4...
Let pi = P(X = i) and suppose that p1 + p2 + p3 + p4 = 1. Suppose that E(X) = 2.5. (a) What values of p1, p2, p3, and p4 maximize Var(X)? (b) What values of p1, p2, p3, and p4 minimize Var(X)?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT