Question

In: Computer Science

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 smooth serial execution of
another process. Assume static scheduling (a process gets a fixed processor.)

[question-a]

Example. A scenario (possibility) is that all four processes are assigned
to CPU-0 (or symmetrically to CPU-1). In that case the turnaround time
for the jobs would be 40+20+20+10 i.e. 90s independently of the order of
execution of each process. Since we gave you a correct answer it is not any more part of the question (i.e. set of valid answers) any more.

2.)

This is a continuation of the previous problem. That's why the question has a (b).

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.

(b) What if dynamic scheduling is possible (and a process can start on one processor and then move to another one after preemption)? How small can the turnaround of the job be?

Solutions

Expert Solution


Related Solutions

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
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...
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...
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;       ...
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...
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?
P1) Duplicated code P2) Feature Envy P3) Long Method P4) Intimacy (same questions for each) 1)...
P1) Duplicated code P2) Feature Envy P3) Long Method P4) Intimacy (same questions for each) 1) What is this ? What problem will it cause? 2) Can you show any example for this problem? 3) What is you solution? Show an example.
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...
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT