Question
Can you please choose the correct answer
arrival time Bust time pl for the above table, under FCFS scheduling, processes are scheduled as follows: a. pl, p4, p2, p3 b. pl, p2, p4, p3 c. pl, p2, p3, p4 d. p2, p4, p3, pl arrival time Bust time 13 for the above table, under SJF scheduling, processes are scheduled as follows c. d. p3, pl, p4, p3 X pl, p3, p4, p2 pl, p3, p2, arrival time Bust time 13 for the above table, under round robin (with time quantuam equals 4) scheduling a. Average waiting time equals 10 c. process 4 finishes its burst before d. none of the above b. Average response time equals 15 . OS estimates the next CPU burst for SJF scheduling by using an equation like 0 20 37 57 77 97 117 121 134 154 for the above gant chart, using round robin scheduling a. P1 burst time equals 44 b. time quantum equals 17 162 p3 burst equals 57 p4 is less than pl in burst time c. d.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Under First come first serve scheduling(FCFS), the process which comes first will be served first, if more than one process come at same time, one of them will be served first

P1 and P2 arrive at same time t:0 Hence there will be 2 scenarios

(1) If P1 is served first and then P2 will be served.P3 will be served next as P4 arrives after P3 . The order is P1,P2,P3,P4

(2)

If P2 is served first and then P1 will be served.P3 will be served next as P4 arrives after P3 . The order is P2,P1,P3,P4.

Hence both P1,P2,P3,P4 or P2,P1,P3,P4 are correct. Only one option is provided . Hence choose (c)

2. In SJF(shortest Job First) the process which has short burst time will be served first . P1 and P2 arrive at same time. As P1 has short burst time when compared to P2 it will be served first . At time 4: the burst time left for P1,P2,P3 is as follows 2(6-4),8,5.

At time 6: P1 is completed and we are left with P2,P3.As P3 burst time(5) is less than P2 burst time (8). It is served next.

At time 11 : P3 is completed and we have one process P2 with burst time 8.

At time 13 : P2 is left with burst time 6(8-(13-11)). P4 arrives with burst time 7, as P2 burst time is less than P4.P2 will be completed first, later P4 will be served.

Hence it is P1,P3,P2,P4. Choose (b)

3. Time 0: P1 is allocated 4

Time 4: P2 is allocated 4. P1 burst time left 2(6-4).P3 arrives with burst time 5 .waiting time of P1,P2,P3 are 0,4,0

Time 8: P3 is allocated 4.P1 needs 2, P2 needs 4(8-4).waiting time of P1,P2,P3 are 4,4,4

Time 12: P1 is allocated 2 . P2 needs 4, P3 needs 1(5-4).waiting time of P1,P2,P3 are 8,8,4

Time 13 : P4 arrives with burst time 7 and joins at the end of the queue.

Time 14 : P1 is completed and P2 is served now.waiting time of P1,P2,P3,P4 are 8,10,6,1

Time 18: P2 is completed and P3 will be served now.waiting time of P1,P2,P3,P4 are 8,10,10,5.

Time 19 : P3 is completed and P4 will be served now.waiting time of P1,P2,P3,P4 are 8,10,10,6.

As only P4 is left it will be completed by 19+7=26

average waiting time=(8+10+10+6)/4=8.5

average response time is calculated at which the process is executed for the first time ( for P1 it is 0 as it is served at time 0, for P2 it is 4 as it is served at time 4, for P3 it is 8 as it is served first time at time 8, for P4 it is 19, as it served first time at 19) average response time =(0+4+8+19)/4=7.75

Process P2 finishes before P4

Hence the correct choice is (d)

4." ? n+1 = a*Tn + (1-a) * ? n" is used by OS for estimating the next cpu burst for SJF scheduling.

5. P1 burst time=(20-0)+(97-77)+(134-121)=20+20+13=53

time quantum=20

P3 burst time=(57-37)+(117-97)+(154-134)+(162-154)=20+20+20+8=68

P4 burst time=(77-57)+(121-117)=20+4=24

Hence P4 is less than P1 in burst time

Add a comment
Know the answer?
Add Answer to:
Can you please choose the correct answer arrival time Bust time pl for the above table,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider 5 processes whose Arrival time and CPU Burst time is as follows (Process no: Arrival...

    Consider 5 processes whose Arrival time and CPU Burst time is as follows (Process no: Arrival time: Burst time): P1:0,6 P2:2,4 P3:3,2 P4: 5,5 P5: 6,9 Assume that the processes are scheduled using SJF (Non-preemptive) scheduling algorithm. The average waiting and turaround time is O 5.45, 11.60 O 5.40, 10.60 O 6.50, 10.99 O 5.45, 11.60

  • Consider 5 processes whose Arrival time and CPU Burst time is as follows (Process no: Arrival...

    Consider 5 processes whose Arrival time and CPU Burst time is as follows (Process no: Arrival time: Burst time): P1:0,6 P2:4,2 P3:5,2 P4:6,5 P5:7,9 Assume that the processes are scheduled using FCFS scheduling algorithm. The average waiting and turaround time is O 3.4 and 8.2 O 3.5 and 8.0 O 3.6 and 7.1 3.9 and 9.8

  • Please answer the following question in C++ language Consider the following set of processes, with the...

    Please answer the following question in C++ language Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process            Burst Time      Priority P1. 7 5 P2 2 4 P3 11 3 P4 9 1 P5 5 3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive...

  • C language show all work 1. [50 pts] Given the following set of processes, with arrival...

    C language show all work 1. [50 pts] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Arrival Time Burst time Process P1 P2 P3 P4 4. 3 2 0 0 10 (Note: lower number means higher priority, processes P1, P2, P3, and P4 arrive at the same time, in the given order). a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing...

  • Opearting system 5. [27pts.] Given the following set of processes, with arrival times, priorities, and the...

    Opearting system 5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Process Arrival Time Burst time Priority P1 P2 P3 2 10 P4 (Note: a lower number means higher priority; processes P2- P4 arrive at the same time, in the given order) a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing a non-preemptive Priority scheduling algorithm. Draw a Gantt chart showing...

  • Assume that the three processes arrived in order: Processes                            CPU Burst Time P1  &n

    Assume that the three processes arrived in order: Processes                            CPU Burst Time P1                                           17 P2                                            6 P3                                            8 a.     Please draw the Gantt chart if FCFS scheduling is used. b.    Please calculate the average waiting time and average completion time under FCFS. You MUST show the calculation procedure. c.      Please draw the Gantt chart if Round Robin is used. d.    Please calculate the average waiting time and completion time under RR with q = 3. You MUST show the calculation...

  • 5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of...

    5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Burst time Arrival Time Process 3 P1 4 P2 2 10 P3 P4 (Note: a lower number means higher priority) Draw a Gantt chart showing a FCFS scheduling algorithm. a. b. Draw a Gantt chart showing a non-preemptive Priority scheduling algorithm. c. Draw a Gantt chart showing a Round Robin Scheduling algorithm with quantum of 4ms d. Compute...

  • QUESTION 1 Consider the following set of processes, with the length of the CPU burst time...

    QUESTION 1 Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process            Burst Time      Priority P1                    7                      5 P2                    2                      4 P3                    11                    3 P4                    9                      1 P5                    5                      3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum = 2). b. What...

  • Cpu scheduling

    Consider the following set of processes, with the length of the CPU burst times given in milliseconds:a. Draw four Gantt charts illustrating the execution of the processes using FCFS, Preemptive SJF, a non-preemptive priority, and a RR (quantum=2) scheduling. (30 pts)Note: for the RR consider that the arriving time is 0 for all processesb. What is the average waiting time of each process for of the above scheduling algorithms? (10 pts)P1 8 2 0 P2 5 36P3 1 1 8...

  • Given the following set of processes with corresponding execution times (in ms), arrival times and priority...

    Given the following set of processes with corresponding execution times (in ms), arrival times and priority (1 – highest).  For each scheduling algorithm: Construct a table showing which process is active and for how long until all processes are completely serviced (as done in class). Calculate the average waiting time and turnaround time. Process ID Burst (ms) Arrival time P1 9 0 P2 12 0 P3 3 0 P4 30 0 P5 20 0 P6 10 0 First Come First Serve...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT