Question

In: Computer Science

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 of the processes and what would be the average turnaround time for those 3 processes if RR (Round-Robin) CPU scheduling algorithm with time quantum at 3 were used?

Solutions

Expert Solution

Solution:

Explanation:

=>In SJF alogithm the job which has least busrt time will be executed first if it is available, the job which has largest burst time will be executed at the last.

=>In Round Robin algorithm jobs are executed based on the time quantum.

I have explained each and every part with the help of statements as well as image attached to the answer above.


Related Solutions

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. 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 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?
Consider this hypothesis test: H0: p1 - p2 = 0 Ha: p1 - p2 > 0...
Consider this hypothesis test: H0: p1 - p2 = 0 Ha: p1 - p2 > 0 Here p1 is the population proportion of “yes” of Population 1 and p2 is the population proportion of “yes” of Population 2. Use the statistics data from a simple random sample of each of the two populations to complete the following: (8 points) Population 1 Population 2 Sample Size (n) 500 700 Number of “yes” 400 560   Compute the test statistic z. What is...
. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2...
. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2 > 0 Here p1 is the population proportion of “happy” of Population 1 and p2 is the population proportion of “happy” of Population 2. Use the statistics data from a simple random sample of each of the two populations to complete the following:​​​​​​ Population 1 Population 2 Sample Size (n) 1000 1000 Number of “yes” 600 280 a. Compute the test statistic z. b....
1. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2...
1. Consider this hypothesis test: H0: p1 - p2 = < 0 Ha: p1 - p2 > 0 Here p1 is the population proportion of “happy” of Population 1 and p2 is the population proportion of “happy” of Population 2. Use the statistics data from a simple random sample of each of the two populations to complete the following:​​​​​​ Population 1 Population 2 Sample Size (n) 1000 1000 Number of “yes” 600 280 a. Compute the test statistic z. b....
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a...
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2. a. Find execution time for each processor for a program with 2 x 10 9 instructions. Which one is the fastest? b. If the processors each execute a program in...
Consider three different processors P1, P2, and P3, executing the same instruction set. P1 has a...
Consider three different processors P1, P2, and P3, executing the same instruction set. P1 has a clock cycle time of 300 picosecond and a CPI (clock cycles per instruction) of 1.5. P2 has a clock cycle time of 400 picosecond and a CPI of 1.0. P3 has a clock cycle time of 250 picosecond and a CPI of 2.0. P1 is running a program with 10 instructions. P2 is running a different program with 20 instructions. P3 is running a...
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a...
Consider three different processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz clock rate and has a CPI of 2.2. a. Which processor has the highest performance expressed in instructions per second? b. If the processors each execute a program in 10 seconds, find the number of cycles and the...
module traffic(clk, reset, P1, P2, P3, P4, PL); input clk; input reset; output[4:0] P1; output[4:0] P2;...
module traffic(clk, reset, P1, P2, P3, P4, PL); input clk; input reset; output[4:0] P1; output[4:0] P2; output[4:0] P3; // four roads output [4:0] P4; output[3:0] PL; //Pl is pedestrian reg [4:0] P1; reg [4:0] P2; reg [4:0] P3; reg [4:0] P4; reg [3:0] PL; reg [4:0] sig; always @(posedge clk or negedge reset) begin    if(reset == 1'b0)begin        P1 <= 5'b00100;        P2 <= 5'b00100;        P3 <= 5'b00100;        P4 <= 5'b00100;       ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT