Question

In: Computer Science

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?

Solutions

Expert Solution

Question 1) What is the average waiting time for RR scheduling (time quantum = 5)?

P1 completed at 19

P2 completed at 22

P3 completed at 24

P4 completed at 18

Turnaround Time = Complete Time - Arrival Time

19 - 0.0 = 19

22 - 0.0 = 22

24 - 0.0 = 24

18 - 0.0 = 18

Waiting Time = Turnaround Time - CPU burst Time

19 - 6 = 13

22 - 8 = 14

24 - 7 = 17

18 - 3 = 15

Average waiting time for RR scheduling (time quantum = 5) = (13 +14 + 17 + 15) / 4

= 14.75

Average waiting time for RR scheduling = 14.75

Question 2)

What is the average waiting time for SJF scheduling?

P1 completed at 9

P2 completed at 24

P3 completed at 16

P4 completed at 3

Turnaround Time = Complete Time - Arrival Time

9 - 0.0 = 9

24 - 0.0 = 24

16 - 0.0 = 16

3 - 0.0 = 3

Waiting Time = Turnaround Time - CPU burst Time

9 - 6 = 3

24 - 8 = 16

16 - 7 = 9

3 - 3 = 0

Average waiting time for RR scheduling (time quantum = 5) = (13 +14 + 17 + 15) / 4

AAverage waiting time for SJF scheduling = (3 + 16 + 9 + 0) / 4 =

= 28 / 4

Average waiting time for SJF scheduling = 7

Question 3

What is the average waiting time for FCFS scheduling?

P1 completed at 6

P2 completed at 14

P3 completed at 21

P4 completed at 24

Turnaround Time = Complete Time - Arrival Time

6 - 0.0 = 6

14 - 0.0 = 14

21 - 0.0 = 21

24 - 0.0 = 24

Waiting Time = Turnaround Time - CPU burst Time

6 - 6 = 0

14 - 8 = 6

21 - 7 = 14

24 - 3 = 21

Average waiting time for FCFS scheduling = (0 + 6 + 14 + 21) / 4

= 41 / 4

Average waiting time for FCFS scheduling = 10.25

  


NOTE: If you have any doubt, please let me know through comments; I will surely revert back to you.

Please give a up vote .....
Thank you...


Related Solutions

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...
Suppose there are 4 processes P1, P2, P3 and P4 getting to ready queue in various...
Suppose there are 4 processes P1, P2, P3 and P4 getting to ready queue in various arrival times and with various bursts times as detailed in the table below. Using Shortest-remaining-time-first scheduling approach, find waiting time for each process and the average waiting time and provide detailed steps taken to find the answer. Using time quantum of milliseconds. Process Arrival time (ms) Burst Time (ms) P1 0 8 P2 2 3 P3 6 2 P4 9 7
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...
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)?
11. Consider three processes P1, P2, and P3, and all them three are ready to run...
11. Consider three processes P1, P2, and P3, and all them three are ready to run at time = 0. Each process has two CPU bursts. When its first CPU burst is completed, each process requests a blocking I/O operation on a separate I/O device. When a process starts to receive service for I/O, the OS scheduler selects and dispatches another process available at the ready queue. The CPU scheduling policy is preemptive priority-based scheduling, where a process being running...
Serial Problem Business Solutions LO P1, P2, P3, P4 [The following information applies to the questions...
Serial Problem Business Solutions LO P1, P2, P3, P4 [The following information applies to the questions displayed below.] Santana Rey created Business Solutions on October 1, 2015. The company has been successful, and its list of customers has grown. To accommodate the growth, the accounting system is modified to set up separate accounts for each customer. The following chart of accounts includes the account number used for each account and any balance as of December 31, 2015. Santana Rey decided...
Required information Serial Problem Business Solutions LO P1, P2, P3, P4 [The following information applies to...
Required information Serial Problem Business Solutions LO P1, P2, P3, P4 [The following information applies to the questions displayed below.] Santana Rey created Business Solutions on October 1, 2017. The company has been successful, and its list of customers has grown. To accommodate the growth, the accounting system is modified to set up separate accounts for each customer. The following chart of accounts includes the account number used for each account and any balance as of December 31, 2017. Santana...
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.
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT